Its not working


#1

its not working, can u help me with that
var james = {
job: "programmer",
married: false,
speak: function( james ) {
console.log("Hello, I am felling"+ " " +james)
}
};

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


3. Literally Speaking
#2

there was a semicolon missing at the end of line

console.log("Hello, I am felling"+ " " +james);


#3

speak: function( james ) { // Change james to end
console.log("Hello, I am felling"+ " " +james) // Change james to end 

james.speak("great"); // This is fine.
james.speak("just okay"); //This is fine.

The problem is in this part with the parameter you've given the speak method, james
jamesis the name of the object, so you should use a different name for this, such as what I used ;end

Here's the full code, edited the way I told you to do it (it's got no problems):

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

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

Yes, but this wouldn't have affected how the function ran.


#4

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