Your second "for" loop, help me! my result - 1)))


var text = "Osas sfsf Artem sfsfs sfjfjcnlw fofkla ortem jfks psjf";
var myName = "Artem";
var hits = [];
for (var i=0; i<=myName.length; i++);
if (text[i] === "A");
for(var j = i; j <=(myName.length+i); j++);


Hi you shoudl read this post


you should remove the ; at the and of these lines

for (var i=0; i<=myName.length; i++);< --
if (text[i] === "A"); <---
for(var j = i; j <=(myName.length+i); j++); <---

the you should open and close your for loops and the if statement wih { }

for (statement1; statement2; statement3){
   if (condition) {
       for (statement1; statement2; statement3) {



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