0
How can one debug in JavaScript
Debug in Javascript
3 Respostas
+ 1
Any example please. Thanks
+ 1
Example please. Thanks
0
Console.log is your greatest friend I think. Chrome tools console used with it would be very helpful.
you can define the function below in a js script.
const add=(x,y)=>x+y;
run the script directly from the linked html file or through live server. on chrome you can press f12 and access console. then run
console.log(add(2,3))
which should run without errors.
you can then try
console.log(add(3,6,3))
that should give an error because the function gets more arguments than it expects. the error message is actually helpful in debugging.