New to coding and new to this website. I did try to search for the answer to my question in the previously asked questions section but they all seemed way above my pay-grade. So, below is my code I'm using and my question is below it. (btw I'm using codeacademy to learn if this stuff looks really basic :/)
var greeting = function(name)
{
console.log("Great to see you," + " " + "name");
};
greeting("Matt");
My question, I cant figure out what i'm doing wrong (if anything). I was under the impression that in the line:
greeting("Matt");
it would populate the name I entered there and tether it together with the other part of the string I declared in the "var" as shown below:
"Great to see you, Matt"
Unfortunately it does not. It is merely printing to the console "Great to see you, name". I feel like I needed to declare something to recognize the input I put below but the example given as a guide doesn't do this and it prints out properly as "Great to see you, Emily" in the example.
Any help would be greatly appreciated. Additionally, I tried my best to format this in the most readable way possible. If you have any tips for future questions and discussions it would be appreciated!
"name"instead of a variable! usenameinstead"Matt"). How should JavaScript know that if you use"name"you want to get the value of the variablenameinstead of the string"name"? It cannot.