I'm not sure if I fully understand your question, but console.log() works in most JavaScript environments.
You can use it in web browsers (open the console with F12), where it prints output in the browser console.
ah, the node.js is where it works, i think?