3/30 - I pass, but gets an error


#1

It says: ReferenceError: speak is not defined

Does anyone know what it is referring to?

var james = {
    job: "programmer",
    married: false,
    speak: function(mood) {
    console.log(speak)     
    }
};

james.speak("Hello, I am feeling great");
james.speak("Hello, I am just okay");

Best regards,
Samuel


#2

It does not understand what this "speak" is that you refer to. You have a function and it's parameter is "mood", maybe try that :relaxed:


#3

I tried with:

var james = {
    job: "programmer",
    married: false,
    speak: function(speak) {
    console.log(speak)     
    }
};

james.speak("Hello, I am feeling great");
james.speak("Hello, I am just okay");

And I just get:

Oops, try again. It looks like your speak method doesn't properly take in a single argument and output the correct string.


#4

This is because the exercise is telling you to put in "mood" and output then the text with the mood:

var james = {
    job: "programmer",
    married: false,
    speak: function(mood) {
    console.log("Hello, I am feeling " + mood)     
    }
};

james.speak("great");
james.speak("just okay");

#5

Oh. ^^ Didn't see that one coming. ^^


#6

i'm still having the same problem, in french version
ar jules = {
job: "developpeur",
fiance: false,
parle: function(humeur) {
console.log("Salut, je me sens " + humeur);
}

};

jules.parle("super");
jules.parle("pas mal");

i get the same error
Oops, try again. It looks like your speak method doesn't properly take in a single argument and output the correct string.


#7

is it "ar" instead of "var in french version?


#8

i just copied it wrong, it is var..it is not working


#9

maybe change your parle method to speak (they might of missed the change of name in the french version


#10

i already did it, an error comes to tell me to do not change the code provided


#11

It looks correct to me i can't see anything wrong with it
just copied and pasted it and got the correct output (only thing i changed was adding the "var" but you told me that was just missing from the copying so could be an error in the french compiler looking for the wrong things???
do you get the right thing logged to the console?