stringTo javascript
<p>I am hoping that I can get some help with my learning and find out what it is about my function that is not working correctly:</p>

<pre><code>function contains() {
 var substr = 'bar';
 var str = 'foobar';
  if (str.indexOf(substr)) {
   // Return true if substr is a substring of str
   return true;
  } else {
   // and false if substr is not a substring of str
   return false;
  };
 }
</code></pre>

<p>Thank you in advance for anyone who can help me get over this bump in learning.</p>

<p>Rob</p>
