title: Is String.contains a standard function in JavaScript?
body: <p>Recently I was writing logic in JavaScript and I wrote something like this</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var str="hello world";
  
  if(str.contains("w"))
      //do something
  else
     //do anotherthing</code></pre>
  </div>
  </div>
  </p>
  
  <p>I thought it  was working fine until I ran the page in Chrome. In Chrome I'm getting an error of <code>contains is not a function</code>. </p>
  
  <p>Although I got rid of this by modifying the logic as   </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var str="hello world";
  if(str.indexOf("w")!=-1)
      //do something
  else
     //do another thing</code></pre>
  </div>
  </div>
  </p>
  
  <p>is <code>contains</code> not a standard ECMAScript function? I'm able to see <code>contains</code> through intellisense  in Firefox but not in Chrome.</p>
  
  <p>While testing these in different browsers I noticed in the console that</p>
  
  <p><code>String.subString/indexOf  //not showing in chrome but works in Firefox</code></p>
  
  <p>instead  <code>str.substring/indexOf</code> works in chrome </p>
  
  <p>Aren't these methods are part of standard <code>String</code> object?</p>