Introduction To Objects II: "Literally Speaking" Exercise


#1


https://www.codecademy.com/courses/objects-ii/0/3?curriculum_id=506324b3a7dffd00020bf661#


I successfully completed the exercise but I notice no message is printed out to the console. I opened chrome Developer Tools to see if the print output was sent to the browser console but nothing was printed to the browser console too. It says I successfully completed the lesson but the instructions suggest that the print statement should output to the console window. I'm not sure if there is something wrong with my code?


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

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


#2

I ran your code on Google Chrome's console on my end, and it printed out just fine...

Same on Codecademy:

Try clearing your cookies and restarting the browser, maybe?


#3

Thanks, I'll try this if I come across the issue again.


#4

Hello:
How do you open the console in Google Chrome? I go to More Tools, Developer Tools, but the window doesn't look like your console image.


#5

There are a few ways:

  • Use the keyboard shortcut Command + Option + J (Mac) or Ctrl + Shift + J (Windows/Linux).
  • Select > More Tools > Developer Tools > look for the "Console" tab/option
  • While inspecting the page, select the Console tab

I often do the last option out of habit, since I inspect the markup and CSS quite often (which is right-click page, and select "Inspect", or Ctrl+Shift+I).

Below is a link for even more details on how to use Google Chrome's console, if you're interested:
https://developers.google.com/web/tools/chrome-devtools/debug/console/


#6

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