title: Extend string prototype : change the uppercase to lowercase and vice versa
body: <pre><code> &lt;script&gt;
  
    String.prototype.swapCase = function() {
      for (var i = 0; i &lt; this.length; i++) {
        if (this[i].toUpperCase() == this[i]) {
          this[i] = this[i].toLowerCase();
        } else if (this[i].toUpperCase() != this[i]) {
          this[i] = this[i].toUpperCase();
        } else {
          this[i] = this[i];
        }
  
  
      }
      return this
    };
  
    document.write("hello".swapCase());
  &lt;/script&gt;
  </code></pre>
  
  <p>And the output is still hello, no uppercase applied. </p>
  
  <p>I am expecting sth like "Hello".swapCase() ➞ "hELLO"</p>