4 ms·
JS standard library is very limited. So, pulling in third party dependencies to even left pad a string is normal.
by ashishb 2y ago
JS standard library is very limited.
So, pulling in third party dependencies to even left pad a string is normal.
- throwaway63820 2y agoyou mean the native `str.padStart(targetLength, padString)`
- zamadatix 2y agoTo be fair (as one who leans pretty heavy in favor of the JS world) .padStart() was only added in response to the aforementioned left-pad fiasco. The language adding that was more a face saving measure from the blowback than an attempt to fix the actual problems. Despite all that, left-pad still gets > 1 million weekly downloads on npm.