12. Loops and arrays II



SyntaxError: missing ) after argument list
Oops, try again. There was a problem with your syntax.

var names = ["Qasim", "Hamad", "Fahad", "Usmaan", "Adnaan"]; 
for (var i = 0; i < someNum; i ++)  {
    console.log("I know someone called" names[i]); 


Hi this line

for (var i = 0; i < someNum; i ++)

where you put somNum you should put names.length
then here

console.log("I know someone called" names[i]);

add the + before names[i] and then put a space before the closing " like that

console.log("I know someone called " +..


Thanks man, it works now.,


Have you really understand what he tell you ?
The + sign will allow you to Addition two Numeric value or Concatenate two variables, one of them containing String.
array.length permit you to get the total length of the array, so you can iterate between 0 and the last index which is array.length - 1.
for (var i = 0; i < array.length; i++) or for (var i = 0; i <= array.length - 1; i++) to be more precise.