title: Which String method: "contains" or "indexOf > -1"?
body: <p>Which of the following ways is an efficient way of determining substring containment?</p>
  
  <pre><code>if (str.indexOf("/") &gt; -1)
  </code></pre>
  
  <p>or</p>
  
  <pre><code>if (str.contains("/")) 
  </code></pre>