Method description:
This method is the same as console.error(). You can tell by looking at the source code that console.error is actually a direct call to console.warn
grammar:
The code copy is as follows:
console.warn([data], [...])
Receive parameters:
console.log accepts several parameters. If there is only one parameter, the string form of this parameter is output.
If there are multiple parameters, it is output in a format similar to the C printf() command.
If there are no parameters, just print a newline
example:
The code copy is as follows:
var count = 1234;
console.error('count: %d', count);
Source code:
The code copy is as follows:
Console.prototype.warn = function() {
this._stderr.write(util.format.apply(this, arguments) + '/n');
};