var james = { job: "programmer", married: false, sayJob: function() { // complete this method console.log("Hi, I work as a " + this.job); } }; // james' first job james.sayJob(); // change james' job to "super programmer" here james.job = "super programmer"; // james' second job james.sayJob(); 

For some reason, I don't see console.log() printing the data. This is one of the lessons on the codecademy, and the built-in interpreter shows nothing. Checked on another site - also nothing. Does anyone know what is the matter?

screen 1 screen 2

  • Add a picture that shows what is not printing - Grundy
  • In that console you have closed? - Mik
  • @ in43sh You are not looking there ... the console should be opened at the browser - Alexey Shimansky
  • 2
    @in43sh Well, open the browser console - this is not exactly that. As @Grundy wrote - for some services the console output is duplicated in the window. Here is my screen at the top showing that your code in the codeacademy working ...... and in another editor it is written that in order to output the data you need to use write and writeln that is, this is your mistake and oversight - Alexey Shimansky
  • one
    @in43sh in your case maybe there was some short-term glitch in the code of the academy. Try console.log again in any lesson. Should work. If it does not work, then you can open the browser console and see what happens there, maybe there are some errors there. In this case, representatives of the school (codeacademy) can show that something has broken. But I think it was something short - Alexey Shimansky

1 answer 1

Your code is absolutely functional. Check this:

Save it to a text file with the .html extension, framing it with a <script> :

 <script> // Ваш код... </script> 

Open browser console (for Firefox: Settings - Development - Web console)

Open the saved file in the browser.

PROFIT

Probably really have codeacademy glitches.