+ 4
What is the use of console in js
What is the use of console found in every web browser and what is the of console.log command in JS?
5 Answers
+ 3
As Charlie said, it's used mostly for debugging purposes.
Imagine you have a function that it's not behaving as expected because it's not receiving the expected parameter's values, what you do is you print to the console the variables used as parameters to confirm the values, and then you just press "F12" in your favorite browser and look for the console output, in there you will find the result.
Please consider that no matter how good your IDE is on regard of debugging, nothing will replace the most simple and reliable technique, which is printing the variables and the function returns to the console for confirmation.
Good luck to you.
+ 2
console is used to test your javascript code
+ 2
+ 1
Thanks Charlie Da stiles and Roberto Guisarre for helping me. I am totally new at field of programming