Function Recap


Write a function called nameString()
It should take name as a parameter.
The function returns a string equal to “Hi, I am” + " " + name.
Call nameString() by passing it your name, and use console.log to print the output.

This is my code but it is not working

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


console.log is currently not logging anything? It should log the returned result of nameString


How I can do that? I tried that but its giving me empty value


console.log("what we want to log to console");, what we want to log the console can also be the result of a function call by including the function call inside the parentheses


Can you give an example


given console.log() the argument of nameString("Mike"); instead of the string i demonstrated


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