The console module provides a debugging console that is similar to the JavaScript console mechanism works in web browsers.
Example (main.js)
console.log('hello world');
console.log('hello %s', 'world');
Output :
Prints to stdout with newline with Optional Multiple arguments.
Example (main.js)
console.info('Hi,I am learing node.js');
Output :
Example (main.js)
console.error(new Error('Hi,I am learing node.js'));
Output :
Prints to stderr with newline. Multiple arguments can be passed,
first used as the primary message and all additional used as substitution values.
Example (main.js)
console.warn('Hi,I am learing node.js');
Output :
console.time('myTimeExample');
//Your Statement
console.timeEnd('myTimeExample');
Output :
Example (main.js)
console.trace("I am learning nodejs");
Output :
- console.log([data][, ...])
Example (main.js)
console.log('hello world');
console.log('hello %s', 'world');
Output :
- console.info([data][, ...])
Prints to stdout with newline with Optional Multiple arguments.
Example (main.js)
console.info('Hi,I am learing node.js');
Output :
- console.error([data][, ...])
Example (main.js)
console.error(new Error('Hi,I am learing node.js'));
Output :
- console.warn([data][, ...])
Prints to stderr with newline. Multiple arguments can be passed,
first used as the primary message and all additional used as substitution values.
Example (main.js)
console.warn('Hi,I am learing node.js');
Output :
- console.dir(obj[, options])
- console.time(label)
- console.timeEnd(label)
console.time('myTimeExample');
//Your Statement
console.timeEnd('myTimeExample');
Output :
- console.trace(message[, ...])
Example (main.js)
console.trace("I am learning nodejs");
Output :
- console.assert(value[, message][, ...])
- console.dirxml(...data)
No comments:
Post a Comment