This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
text = "Kanye says: This string has the name Kenny embeded in it\n the following function should find it."; | |
var myName = "Kenny"; //String to find | |
var hits = []; // Empty array to put it into | |
var altHits = []; // Empty list for alternative hits | |
// Look for "K" in the text | |
/* | |
Loop over numbers from `0` to `text.length` | |
so you can access the single characters of `text` |