Function


#1

I can't figure out what I am doing wrong here

var nameString = function (name)
{return "Hi, I am" + " " + name);};
console.log(nameString(John))


#2

John should be a string


#3

isn't that what I have?


#4

no, you make a string like this "John" and also you have an extra paran()) here:


#5

Like this :

var nameString = function (name) {
return "Hi, I am" + " " + name
};
console.log(nameString("John"));


#6

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