Writing a loop and array that searches text for a word and it comes up with this syntax error I've been looking over the code but can't seem to notice any errors.
jshint multistr:true
var text = "Usually, solar companies install\
solar panels on roofs but Elon Musk offers an\
entirely different and ingenious approach";
var myName = "Elon";
var hits = [];
for(var i=0; i <= text.length; i++) {
if(text[i] === 'E') {
for(var j = i; j < (myName.length + i); j++) {
hits.push(text[j]);
}
}
}
if (hits.length === [0]) {
console.log("Your name wasn't found!");
} else {
console.log(hits);
}
hits.length === [0]? Do you meanhits.length === 0?