Intro to function: "nameString function doesn't work" What have I done wrong?


This function is supposed to print "Hi, I am Khadz", but when I run it, I get back this error message:

Oops, try again. Your code doesn't look quite right.

What have I overlooked or did wrong?

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



problem is in the function call:


The computer does not know what the Khadz is. It's not a primivtive type (like 12.5, 'Hi' etc.) and variable called Khadz is not defined.

You were supposed to pass a string as a parameter (nameString('Khadz')).


Thank you! It's the little things that still count -- I missed the quotation marks. Thanks again :slight_smile:


You're very welcome :slight_smile:


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