What's the difference?

What is the difference between console.log() and println?

And when would you use either one of them when coding?

Is console.log the same console when viewing “console” when inspecting a webpage?

that depends on which println you are talking about,
I haven’t heard of a println in Javascript.

for details, click here.

document.writeln() is a function in javascript, but it puts stuff on a webpage.
console.log() puts things into the console, not the webpage the user is looking at.

console.log() in JavaScript does the same as what System.out.println() does in Java, but that’s not JavaScript.

And yes, its the same console.

source: Quora post

1 Like