
What if we had a great standard library in JavaScript? - colinprince
https://medium.com/@thomasfuchs/what-if-we-had-a-great-standard-library-in-javascript-52692342ee3f#.lea7425lu
======
tantalor
> utter lack of certain useful functions (for example a function to format
> numbers in strings, like printf)

Huh?

[https://developer.mozilla.org/en-
US/docs/Web/JavaScript/Refe...](https://developer.mozilla.org/en-
US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)

Example,

    
    
      > (123).toString(16)
      > "7b"

~~~
tantalor
Also, if you _really_ want printf,

[https://developer.mozilla.org/en-
US/docs/Web/API/console#Usi...](https://developer.mozilla.org/en-
US/docs/Web/API/console#Using_string_substitutions)

Example,

    
    
      > console.log("test %s test", "hello")
      > test hello test

