11. still got error. Please help!


#1

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

still got error. Please help!


11.Functions Recap
#3

var nameString = function (name) {
console.log("hi, i am" + " " + name);
};
nameString("Roni");
this also show error.
The instruction is:
1.Write a function called nameString() It should take name as a parameter.
2.The function returns a string equal to "Hi, I am" + " " + name.
3.Call nameString() by passing it your name, and use console.log to print the output.


#4

The code looks good. Try to refresh the page and submit again.


#5

I think you did not follow the instruction properly...
maybe you try this:
1. var nameString = function (name)
2. {return "Hi, I am" + " " + name}
3. {var newName = nameString("Roni");
4. console.log(newName);}


#6

Please reply me if it works for you.


#7

had same problem, this works


#8

Looking at teewex's post I can see an error in my earlier post - I'll remove it. Another solution which works is:

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


#10

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