1
0
First question here. I am doing Codecademy's JS basics course and have run into a question concerning concatenation in functions.
I have:
var greeting = function(name){
console.log("Hello, "+"" +name);
};
Obviously, when I call this function with:
greeting("Chris");
I get, Hello, Chris
What if I wanted to spice that up a bit and have the output say, Hello, Chris. How are you doing today?
I tried several different things that all lead to syntax errors. For example:
var greeting = function(name){
console.log("Hello, "+"" +name "." ""+" How are you doing today?);
};
So, the question is how do I join the next strings after including the function output following the initial string? I don't know if that sentence makes any sense. So, In plain english, how do I get the period and the subsequent question in there after the output, Hello, Chris
?
Thanks for any help!
Issues specific to programming and software development are off topic, see What topics can I ask about here?. Try [SO] but please first read How do I ask a good question?.
– DavidPostill – 2015-03-30T17:15:46.833