What do I do to correct my output? Help please


#1


var myName = "Josiah";
var text = "Hey, how are you \
doing? My name is Josiah.";
var hits = [1];
for(var i = 0; i < text.length; i++); {
 console.log ("Hey, how are you doing? My name is Josiah.");    
if (text[0] === 'J') {
    console.log ("J");   
};


#2

The output just says that the end is unexpected... please, I need help!!!!!


#3

you need another closing bracket } to close your for loop before this one:


#4

Thanks :smiley_cat: :slight_smile: :smile:


#6

Now what am I doing wrong in my 2nd for loop?

var myName = "Josiah";
var text = "Hey, how are you \
doing? My name is Josiah.";
var hits = [1];
for(var i = 0; i < text.length; i++); {
console.log ("Hey, how are you doing? My name is Josiah.");
};
if (text[0] === 'J') {
console.log ("J");
for(var i = 7; i < myName.length; i++) {
newArray[7];
newArray.push('Hey');
};
};


#7

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