0

In C there is a printf function that I can put %d in the statement and pass the value into it later.

I ma just wondering is there a similar function in Javascript so that I can do something like printf("The number is: %d", 18) and it return a string "The number is:18"?

I searched online and I found an open source call sprint, but it seems to be over-kill since I don't use this frequently in my project.

Many thanks!

Guifan Li
  • 1,543
  • 5
  • 14
  • 28
  • No, Javascript doesn't have built-in formatted output. – Barmar Apr 21 '15 at 19:07
  • Something like this question? http://stackoverflow.com/questions/18405736/is-there-a-c-sharp-string-format-equivalent-in-javascript – SLin Apr 21 '15 at 19:07

0 Answers0