Tuesday, 2 October 2018

node.js: Evaluate the expressions in console messages

You can evaluate the expression by placing the string in back ticks ``

HelloWorld.js
var x = 100;

console.log(`Value of x is ${x}`)
console.info(`Value of x is ${x}`)
console.warn(`Value of x is ${x}`)
console.error(`Value of x is ${x}`)

Output
Value of x is 100
Value of x is 100
Value of x is 100
Value of x is 100



Previous                                                 Next                                                 Home

No comments:

Post a Comment