There is no universal way of debugging client-side JavaScript. The only way to debug client-side JavaScript is through the browser. Server-side JS can be debugged in several ways, including VS Code, NodeJS, and the V8 Inspector. Fortunately all browsers have their own debugging tool/plugin that makes it easier:
- Firefox has Firebug
- Chrome and Opera have Web developer mode
- Internet Explorer has F12