Javascript in here is different from one in w3school tutorial. why?


for example: console.log here and console.log in w3school tutorial don't give same result. I don't get it.


Could you describe in your own words
what differences you see....?

take a look at the bottom of the page

console.log does here what document.write does there... elsewhere it says console.log is used for debugging



console.log outputs to the console but document.write outputs to the webpage. (I think) Maybe you can try it.


It is confusing for beginners. Codecademy makes it simple for beginners, by outputting console.log() to a part on screen/webpage. While in real usage console.log() writes to the JavaScript console, which on Google Chrome you can access by pressing CTRL + Shift + J (You can type any JavaScript here).

So JavaScript is same here and on W3School.