Home  >  Article  >  Web Front-end  >  Instructions for using the console.info method in node.js_node.js

Instructions for using the console.info method in node.js_node.js

WBOY
WBOYOriginal
2016-05-16 16:27:581679browse

Method description:

This method is the same as console.log(). From the source code, it directly calls console.log.

Grammar:

Copy code The code is as follows:

console.info([data], [...])

Receive parameters:

Accepts several parameters. If there is only one parameter, the string form of this parameter will be output.

If there are multiple parameters, it will be output in a format similar to the C language printf() command.

If there are no parameters, just print a newline character

Example:

Copy code The code is as follows:

var count = 1234;
console.info('count: %d', count);

Source code:

Copy code The code is as follows:

Console.prototype.info = Console.prototype.log;
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn