How to debug JavaScript or Node.js applications?

How to debug JavaScript or Node.js applications?