Created
February 15, 2015 09:15
-
-
Save kshirish/52c9e8f3a307edf2576e to your computer and use it in GitHub Desktop.
node api
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// writes to stdout, same as info | |
console.log('hello %d', 2015); | |
//writes to stderr, same as warn | |
console.error('hello %d', 2015); | |
console.dir({ | |
name: 'John doe', | |
address: { | |
city: 'NY', | |
state: 'DC' | |
} | |
}); | |
console.time('time-tick'); | |
setTimeout(function(){ | |
console.timeEnd('time-tick'); | |
}, 4000); | |
// produces stack trace at the point | |
var i = 0; | |
for (;i<4;i++) { | |
console.trace('trace-message'); | |
} | |
// throw assert message if first argument is true | |
console.assert(4 > 7, 'assert-message'); | |
console.assert(4 < 7, 'assert-message'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment