MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/javascript/comments/p0e76/how_come_javascript_doesnt_have_printf/c3lhpfq/?context=3
r/javascript • u/Samus_ • Jan 28 '12
13 comments sorted by
View all comments
4
The base library was made for doing stuff in a browser.
printf (and friends) are more for CLI things.
printf
That's the best explanation I can offer.
https://github.com/epeli/underscore.string
http://www.diveintojavascript.com/projects/javascript-sprintf
Edit: If you want to use it for outputting markup, use templates instead (Mustache or Handlebars).
4
u/x-skeww Jan 28 '12 edited Jan 28 '12
The base library was made for doing stuff in a browser.
printf(and friends) are more for CLI things.That's the best explanation I can offer.
https://github.com/epeli/underscore.string
http://www.diveintojavascript.com/projects/javascript-sprintf
Edit: If you want to use it for outputting markup, use templates instead (Mustache or Handlebars).