2 ms·
Thanks for the code review. To me this is the ultimate irony of this whole thing. Many have read it as "you should have written your own leftpad function, it's
by kennywinker 11y ago
Thanks for the code review. To me this is the ultimate irony of this whole thing. Many have read it as "you should have written your own leftpad function, it's 11 lines!!" But no bit of code is too short to be buggy / inefficient. Centralizing it allows us to optimize/fix once.
While my implementation is basically a direct port of node's leftpad, pull requests are welcome. :)