Function Recap


#1

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;
	
	
};
nameString("Mike");
console.log();

#2

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


#3

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


#4

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


#5

Can you give an example


#6

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


#7

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