SyntaxError: Unexpected String


#1

Needing help. Here's my code:

var greeting = function ("Hello" + name) {
    var name = "Leslie"
    console.log(name)
}

What's wrong with it? It's saying it has an unexpected string, but I don't know what the "Unexpected string" is. The topic I'm on is: JavaScript, Introduction to Functions in JS, Meet the functions, Tying it all Together.
Please help! Thanks!


#2

var greeting = function ("hello" + name)

It should be

var name = prompt("What is your name?");
var greeting = function(){
console.log("Hello " + name);
}