title: Check if string contains substring without using any standard JavaScript methods?
body: <p>So I need to implement a javascript method which will return true or false depending on if the masterString contains a subString.</p>
  
  <p>I did something like following but not sure if this is the right approach :</p>
  
  <pre><code>function contains(masterString, subString) {
  if(subString.length &gt; masterString.length){
      return false;
  }
  for(var i=subString.length-1; i&lt;masterString.length; i++){
      if(concatString(i - subString.length-1, i, masterString) === subString){
          return true;
      }
  }
    return false;
  
  }
  
  function concatString(index1, index2, string){
      var conString = '';
    console.log(index1, index2-1, string);
      for(var i=index1; i&lt;index2-1; i++){
          conString += string[i];
      }
    console.log(conString);
      return conString;
  }
  
  
  contains('abcd', 'bc');
  </code></pre>
  
  <p>It isn't working fine though.</p>
  
  <p>Can we implement it? Thanks :)</p>