3.Literally Speaking



The code is displaying in the console as it should:
Hello, I am feeling great / Hello, I am feeling just okay,
Yet I am getting this error message: It looks like your speak method doesn't properly take in a single argument and output the correct string.

Here is my code:

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

james.speak("just okay");

Why am I getting this error message?


i think you need to use + to join the string and variable together


It worked, but why do u need to do that?


it has to do with how the validation works, do i need to get into details?


Yes please (thankyou)


looking at the validition:

if (loggedFromSpeak[0] !== "Hello, I am feeling great" || loggedFromSpeak[1] !== "Hello, I am feeling just okay")

the exercise calls the method, but using a , will separate the log statement incorrectly in the loggedFromSpeak array


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