This language bar is your friend. Select your favorite languages!
Edit summary for version 38 :
[JS] Variable name x. 2 ways => 2 impls

Version 37

Version 38

Idiom #59 Write to standard error stream

Print the message "x is negative" to standard error (stderr), with integer x value substitution (e.g. "-2 is negative").

Idiom #59 Write to standard error stream

Print the message "x is negative" to standard error (stderr), with integer x value substitution (e.g. "-2 is negative").

Imports
const util = require("util");
Imports
const util = require("util");
Code
console.error(util.format("%d is negative", -2));
// or alternatively:
console.error(-2, " is negative");
Code
console.error(util.format("%d is negative", x));
Doc URL
https://nodejs.org/api/console.html#console_console_error_data_args
Doc URL
https://nodejs.org/api/console.html#console_console_error_data_args