5/7: Please help with my syntax


#1

/*jshint multistr:true */
var text = "Hey, what's your name?"
var myName = "Remy Gouahoury Jr."
var hits = []
for (var i = 0; i < text.length; i++) {
if (text[i] === 'R') {
for (var j = i; i + myName.length; i++)
hits.push("Remy Gouahoury Jr.");
}}


#2
  1. "text" and make it a string containing some text. Place your name in there a couple of times! (lesson 2)

var text= "kdjfjal sara fsjflsk djfslfls \
jfslfhsk sara dfsjdf";

var myName="sara";

var hits=[];

for (var i=0; i if (text[i]==="s"){
for (var j=i; j<(i+myName.length); j++){
hits.push(myName);
hits[0];
}
}
}


#3

i have the same problem this is my code /*jshint multistr:true */
var text = "i have to go handle something but i need to stay and finish this.";
var myName = "Antonio";
var hits = [];
for(var i=0; i if(text[i]==="A"){
for(var j=i; j<(i+myName.length); j++){
hits.push(myName);
hits[0];
}
}
}


#4

Still with problems?

I left you my code. It has been marked as correct, =) Happy coding !!

/*jshint multistr:true */

var text = "melocoton ya deberia estar haciendo la meme amo a mi melocoton";
var myName = "melocoton";
var hits = [];
for (var i = 0; i < text.length; i++){
if (text[i] === "m" ){
for (var j = i; j < (i + myName.length); j++){
hits.push("melocoton");
hits[0];
}
}
}