I am creating a function that returns a personalized greeting but when I go to return the function it says I pass 1 out of 4 test
Here is the code:
function greeting('Omari'){
console.log('Hello')
}
greeting();
答案 0 :(得分:0)
Make your code ask for a name with prompt()
. Then write a function that takes a parameter name
and return a greeting:
function greeting(name) {
return "Hello, " + name + "!";
}
var myName = prompt("What's your name?");
alert(greeting(myName));