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


#1


#2

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?


#3

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


#4

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


#5

still showing an Error!!


#6

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

#7


#8

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

};
console.log (nameString ("Sal"))


#9

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