- Home
- /
- Tutorials
- /
- JavaScript Tutorial
- /
- JavaScript Debugging
JavaScript Errors
JavaScript Debugging
Debugging is the process of finding out why code does not do what you expected.
Most bugs come from an assumption that turns out to be wrong.
Debugging is mostly about checking those assumptions one at a time.
Example
Example
javascript
const price = "10";
const quantity = 2;
console.log(typeof price, typeof quantity);
console.log(price * quantity);Printing the types immediately shows the problem.
Here it happens to work, but addition would not.
