Why i cant seem to push my my letters to the aray?


#1

/*jshint multistr:true */
var text = "Hello me is hatim, wazzup";
var myName = "hatim";
var hits = [] ;
for(var i = 0; i < text.length; i++);{
if(text[i] === "h"); {
for(var j = i; j < (myName.length + i); j++); {
hits.push(text[j]); }
}}
console.log(hits);

please help, dont understand why its not putshing my letter.


#2

Remove ; behind for loops and if statement. For them you only use { without any ;


#3

Thank you so much! Its awesome!


#4

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.