Help with 11


#1

I can't seem to figure out what my problem is. I keep getting the error, Unexpected Token Illegal.

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

};
var newName = nameString("Sam");
console.log(newName);


#2

check that line make sure you are using the right amount of quotes around each string


#3

Now I am getting the error, Syntax Error: Unexpected string


#4

Hi try to remove this part .

var newName=nameString("Sam");
console.log(newName);

And just call the function like that

console.log (nameString("Sam"));

#5

I am still getting an error. Here is my code now.

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

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


#6

what he did there was not wrong it is correct

@sam.dunaway
on this line

it was supposed to be this

return "Hi, I am" + " " + name";
                ^             ^(no quote here)
         (mssing the quote here)

#8

Hi...I have the same problem...please help!!


#9

can you post your code and be specific about your problem


#10

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

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

executed.is this correct?


#11

It should be formatted like this:

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

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


#12

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

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