What is the benefit of using
Or any of the other console commands for that matter?
console.info("info"); console.error("error"); console.warn("warn");
I thought it might change the color of the output or concatenate some sort of label, but they seem to all do the same thing. And according to the documentation here:
they seem to all do the same as
According to the documentation that you linked to,
console.warn outputs to
stderr. The others output to
If you are doing piping or redirection from
node.js the difference is important.
Node.js. Having node implement the full console allows for greater code cross-compatibility.
In most browsers, not only do these log in different colors, but you can also filter to see specific messages.
console.info("info"); console.error("error"); console.warn("warn"); console.log("log");