Functions recap ((Ans is printed right still its giving as an error))



Okay, perhaps the error is saying what's wrong?
Have you considered what your function should do? Does it do that? What's the "hell" part supposed to do? Should your function print anything?


■■■■ is a supposed name. but it is showing an error for that. maybe i need a space between them.


What if you want a different name?
What if you want to call it five times with a different name each time?


still showing an Error!!


Then you'll have to read it and consider what it says, right?
And also consider how the function is supposed to act.

console.log(nameString('bob'));   // Hi, I am bob
console.log(nameString('lisa'));  // Hi, I am lisa



var nameString = function (name) {
return "Hi, I am " + "" + name;

console.log (nameString ("Sal"))


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