Loops and arrays II (Space Problem)


#1

I did 2 code, but both of them still not give space between phrase and name, please help me check what i missing?

var names = ["adi", "doni", "jessie", "finx", "priscill"];
for (var i = 0; i < names.length; i++) {
console.log ("I know someone called" +"" + names[i]);
}

and another code

var names = ["adi", "doni", "jessie", "finx", "priscill"];
for (var i = 0; i < names.length; i++) {
console.log ("I know someone called" + names[i]);
}

the result both of them is same, error like this


#2

You need to put a space between the two quotation marks, like so:

+ " " +


#3

oh, i see.. thank you :slight_smile:


#4

Hello,

I am working on the same exercise but it seems that there is a "technical bug".
When I click on the button "save and submit", it doesn't work. I don't have any answer
from the page, whether my code is OK or not. Somehow, it reacts because it shows that the answer is being sent but the whole page stays blocked during an indefinite time.
After a while, I try to refresh the page but still nothing.

I precise that I checked my internet connection and it is OK.

In case it is due to my code, I show you what I have written

var names = ["Paulina","Sara","Giampaolo","Tina","Theo"];
for( var i = 0; i<=names.length; i++){
console.log("I know someone called " + names[i]);
}