Playing around with the code, and ran into a syntax error


#1


Hey guys, I was just playing around with the code but I can't figure out how to add an exclamation mark after the name, when I try to, it just gives me a syntax error. How would I add one?


var greeting = function (name) {
    console.log("Hey there,"+" "+name);
};

greeting("Jeff");


Help would be appreciated.

Thanks!


#2

Does

console.log("Hey there, "+ name + "!");

not work?


#3

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