216k views
2 votes
Why do we use console.log in javascript when changing variables?

User Gnanz
by
5.0k points

2 Answers

3 votes
This usually helps to debug the code
User Pixelpax
by
5.1k points
5 votes
It helps to debug the code. Instead of going through every line of code to find an error, using console.log can tell us where to look.
User Mohamed Amin
by
4.9k points