Open Zorgatone opened 8 years ago
@Zorgatone it's literally one line to replicate the C printf behavior including the return value:
var printf = function() { var o = sprintf.apply(sprintf, arguments); console.log(o); return o.length; };
printf("Hello %s!", "World"); // prints 'Hello World!' to console, returns 12
Maybe we could have a
printf(...)
which would be a wrapper toconsole.log(sprintf(...))
, what do you guys think?