Logo

Programming-Idioms

History of Idiom 59 > diff from v35 to v36

Edit summary for version 36 by glmdgrielson:
New JS implementation by user [glmdgrielson]

Version 35

2018-05-08, 01:16:34

Version 36

2018-05-21, 22:55:24

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");
Code
console.error(util.format("%d is negative", -2));
// or alternatively:
console.error(-2, " is negative");
Doc URL
https://nodejs.org/api/console.html#console_console_error_data_args