3/30 (SyntaxError: missing ) after argument list))


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

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

Can someone help me out on what I'm missing?
It returns as a syntax error with a missing ")" after argument list.


#2

You missed a + between the last " and speak. I made that mistake too... haha
Also remove the } just before the };


#3

Oh my gosh you are my hero ! Thank you this was making me go mad! :sweat_smile:


#4

Glad I helped!

Take it from me who's had some experience in programming (C# and ActionScript).
It's usually these little mistakes that cause errors.

I recall a story one of my lecturers told us. He programs in C &C++ and these languages are less forgiving to mistakes. There was this time when he and his team were working on a project which consisted of several hundreds of files. The code logic seemed ok but the project kept crashing. In the end, it was because one of the lines was missing a semicolon... :expressionless::expressionless::expressionless:


#5

hey here is my code and its working fine :stuck_out_tongue:
var james = {
job: "programmer",
married: false,
speak: function(mood) {
console.log("Hello, I am felling " + mood)
}
};

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