title: Check string contains substring in javascript
body: <p>I'm building a node application and a module of this application checks whether the nameservers of a given domain name point to AWS.</p>
  
  <p>Using the <code>dns</code> module I have the below code:</p>
  
  <pre><code>dns.resolveNs(domain, function (err, hostnames) {
      console.log(hostnames);
      console.log(hostnames.indexOf('awsdns') &gt; -1);
  });
  </code></pre>
  
  <p><code>hostnames</code> outputs an array of hostnames and the specific domain I've used has the following hostname structure (x4):</p>
  
  <pre><code>ns-xx.awsdns-xx.xxx
  </code></pre>
  
  <p>But <code>console.log(hostnames.indexOf('awsdns') &gt; -1);</code> returns <code>false</code>?</p>