As with modern browser, placeholder is supported by new version of Chrome / Firefox, similar as the C style function printf()
.
Placeholders:
%s
String.%d
,%i
Integer number.%f
Floating point number.%o
Object hyperlink.e.g.
console.log("generation 0:\t%f, %f, %f", a1a1, a1a2, a2a2);
BTW, to see the output:
Ctrl + Shift + J
or F12
to open developer tool.Ctrl + Shift + K
or F12
to open developer tool.@Update - nodejs support
Seems nodejs don't support %f
, instead, could use %d
in nodejs.
With %d
number will be printed as floating number, not just integer.