The following code is meant print the namestring with a name. however, it's not correct.
var nameString = function (name) {
return "Hi, I am" + " " + name.
}
nameString("Amir")
console.log(nameString)
What am I not implementing/doing wrong that stops it from displaying the string as well as a name? thanks.
First mistake in your code is in the line
return "Hi, I am" + " " + name.
remove fullstop or just concatenate it as below
return "Hi, I am" + " " + name+"."
and then write
console.log(nameString("Amir"));
check it here fiddle
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With