With console.log
it's possible to give a prinf
-style format string followed by values to substitute into the output.
For example:
console.log("The number is %d", 25);
Normally, the %
can be escaped using another %
when that isn't desired. So in this question I posted an answer to explain that. However, I wasn't able to use a Stack Snippet to demonstrate.
console.log('The number is %%d', 25);
// outputs as "%%d" instead of "%d"
Whatever code is handling console.log
needs to remove one of the %
symbols from the output so that it matches the output from a browser.
console.log
which supports your claim? The Wikipedia page that you linked to mentions neither JavaScript, norconsole.log
.util.format
in it's implementation, which documents%%
, and I can't find documentation by any of the browsers, but I also haven't found a browser that doesn't have the behavior of removing one%
.