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!

2
  • No, Javascript doesn't have built-in formatted output. Commented Apr 21, 2015 at 19:07
  • Something like this question? stackoverflow.com/questions/18405736/… Commented Apr 21, 2015 at 19:07

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.