nameString() in JavaScript


#1

I'm stuck in the javascript functions section on the function nameString().

The instructions are to pass my own name as a parameter, which I've done successfully, more than once.

It keeps giving me messages like ("hmm, doesn't look like it's returning 'Susie' for the name 'Susie'" or
"Hmm, it doesn't look like it's returning 'Bobby' for the name 'Bobby'", even when I declare 'Bobby' or 'Susie'
as the name variable. For the record, my name is Joe, and it returns 'Joe' when I pass it that name variable, but the *(&% @! program isn't giving me credit for having done the exercise correctly. Frankly, it's driving me nuts.


#2

And do you know what drives us nuts? No link to the lesson, for one, and no code sample, for two. How can anybody help if we cannot see what you have done to cause the error message? Please post link and code. Thanks.


#3

var nameString = function (){
var name = "Joe";
return "Hi, I am" + " " + name;
console.log(nameString());
};
nameString();

The problem asks me to pass the function my name, which I did, and when I submit it, it says "Hi, I am Joe.:
But I'm not credited by the powers that be for a correct answer.
Oops, try again. Hmm, it looks like your nameString() function doesn't return 'Hi, I am Susie' for the name Susie.
Above is the feedback it gives me.. This is what was driving me nuts. Sorry for my earlier failure to include a code sample.


#4

var nameString = function (){
var name = "Susie";
return "Hi, I am" + " " + name;
console.log(nameString());
};
nameString()
& when I change name to susie, it says oops! It doesn't shoe the name Bobby. Seems to be an endless loop of that. ;


#5

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