It returns 'function' instead of what I put


#1

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

nameString("Test")
console.log(nameString)


#2

You printed nameString
nameString is a function. Seems reasonable that it says so.


#3

how do I make it print the "Hi, I am" thing?


#4

Call the function and print its result


#5

How do I call the function and print its result? Sorry, I'm a beginner.


#6

If you have a function f then you call f by doing f()
If f requires arguments, then you would put those between the paretheses, f(5)
The function call evaluates to a value that you can then use: 3 + f(5)