June 2014
Intermediate to advanced
696 pages
38h 52m
English
To determine whether a string is a substring of another, you can use the indexOf() method. For example, the following code writes the string to the console only if it contains the word think:
var myStr = "I think, therefore I am.";if (myStr.indexOf("think") != -1){ console.log (myStr);}
Read now
Unlock full access