Why this code won't work


#1


var nameString = function (name ) {
    return "Hi,Iam" +" "+ name;
  
 
};
  
  console.log(nameString("Susie"));

Oops, try again. Hmm, it looks like your nameString() function doesn't return 'Hi, I am Susie' for the name Susie.


#2

Please post your code


#3

Your string should be,

Hi, I am Susie

but the way you have spaced yours would be,

Hi,Iam Susie

Alter the spacing in your return line so that it can print the expected result. :slight_smile:


#4

thank you it works now .


#5

You're welcome :slight_smile:


#6

var nameString= function(name){

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

};

console.log(nameString("Nana!"));
Oops, try again. Hmm, it looks like your nameString() function doesn't return 'Hi, I am Susie' for the name Susie.
I dont know what's wrong


#7

Copy the text string from the instructions and use it to replace what you have in your return statement.


#8

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