0
Why should i use Console.log?
5 Answers
+ 3
console.log() is used to log something to the console.
You can use console.log() for debugging purposes.
+ 2
Because logging something into JS console is less annoying than popping it up in an alert() box or by rewriting document content using document.write()
+ 1
Is it important to use?how much?
+ 1
not much important: mostly used to debug your javascript code ^^
+ 1
when you want to debug your code. In intial days, you don't know about breakpoints and conditional breakpoints. It helps in debuging code. If you don't want to use `console.log()`. don't use it. But, it is good to know.
const sum = (a, b) => a + b;
console.log(add(4, 7));
console.log(add(2, 7));