I don't understand


#1

I want to understand what this for loop is saying before I continue.

var myName = ("Tony")
var hits = []
for (var i = 0; i < text.length; i++)
if (text[i] === 'T'){

Thanks


#2

@javaslayer41260 the for loop is basically looping through your text string, one character at a time. the first part, var i = 0, sets up the initial condition for the counter variable i. The next part, i < text.length, tells the loop that as long as i is less than the number of characters in the text variable, the loop should keep going. The last part, i++, is telling the interpreter to increment i by 1 each time it runs through the loop.