title: Is it bad practice to define a dynamic property on String.prototype?
body: <p>I recently came across the idea that it would be great(/easy/convenient) to define dynamic properties on the Javascript String prototype, so you can use your string literals and variables kinda like it works in ruby. Take this example:</p>
  
  <pre><code>// Using ES2015 syntax features
  Object.defineProperty(String.prototype, 'ucFirst', {
    get() {
      return this.charAt(0).toUpperCase() + this.substr(1);
    }
  });
  </code></pre>
  
  <p>This way you'd be able to use your strings like this:</p>
  
  <pre><code>"foo".ucFirst                        // "Foo"
  "lorem ipsum dolor sit amet".ucFirst // "Lorem ipsum dolor sit amet"
  $t('some_i18nized_string').ucFirst   // You get it
  </code></pre>
  
  <p>I can already imagine a whole bunch of handy applications for that, <strong>but</strong> I am not sure about it. It works, but I am kinda afraid that it might be bad practice and it kinda smells funny.</p>
  
  <p>Let me know what you think about it.</p>