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


#1

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


#2

@y.t.w,
Could you describe in your own words
what differences you see....?


#3

http://www.w3schools.com/js/js_output.asp
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


#4

@y.t.w

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


#5

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.