Hi guys! Why do I need to put "name" in body?


#1

Hi!
Why do I need "name " again in BODY?

var nameString = function (name) {
	return "Hi, I am" +" "+name;


};
nameString("Alex")
console.log();


#2

HI your function has as argument name so when you you put

return "Hi, I am" +" "+name;

and you call you function with your name

nameString("Alex")

it will output

"Hi, I am Alex"

your name inside the call function will take the place of the argument name
HOpe that make you understand it.


#3

OK, now I got that name is parameter and then when I call a fucntion
...
nameString ("Alex")
...
it puts "Alex" instead of name in body,right? And why I put blank quotes there? is it cause string should be in quotes? and parameter not?


#4

yes, its that

The blank quote is for putting the space between ..am and Alex

the don't need of it " " around


#5

OK! now I got the blan quotes.
Thanks a lot!


#6

Are you working in codeacademy or just helping ? I just wanted to contact codeacademy with some offer


#7

No, I just helping you but you could create a new topic with your offer in this session https://discuss.codecademy.com/c/Codecademy-Community-Lounge