This code is accepted but is it correct?


#1

https://www.codecademy.com/en/courses/javascript-beginner-en-6LzGd/2/3?curriculum_id=506324b3a7dffd00020bf661#

There is no error message but the code is accepted, however there is no display output which indicates this code is incorrect?

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

#2

Study this example in comparison to your code:

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

console.log(nameString("mrpixelsheep"));

This is not meant as the solution, only an example to follow.


#3

it is not correct, the function call should be outside the function and inside the console.log:

console.log(nameString("yourname"))

oh, and when you call the function, pass it a string (use quotation marks (") like i just did above)


#4

Got it! Thanks for the reply.