3 ms·
But can it left pad a string?
by keketi 8y ago
But can it left pad a string?
- GordonS 8y agoJavaScript has come a long way in recent years, but the lack of a comprehensive standard library is still absolutely mind boggling.
- emilfihlman 8y agoThis is really pretty sad. A standard library is paramount to a stable and easy to develop ecosystem.
- hombre_fatal 8y agoIt may be, but this is a weird thread to bring that up since Javascript has padStart, and TFA is about building a web server with only the standard library.
- nurettin 8y agothe OP was referring to this incident https://github.com/stevemao/left-pad/issues/4 https://github.com/stevemao/left-pad/issues/4 where a very basic package everyone depended on was yanked from npmjs. azer's original post: https://news.ycombinator.com/item?id=11340510 https://news.ycombinator.com/item?id=11340510
- paulddraper 8y agoJavaScript's standard library has a fair amount. Not Python levels of completeness, but near Java levels. The parent's example is String.prototype.padStart() [1] [1] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/padStart https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
- ng12 8y agoWhat are you missing from the native language + lodash?
- GordonS 8y agoWhile it's a valid point that lodash provides a lot, my point is that with any other language I've ever used, I don't need to add something like lodash.
- Siilwyn 8y agoYes, it is called `padStart`: https://devdocs.io/javascript/global_objects/string/padstart https://devdocs.io/javascript/global_objects/string/padstart
- dang 8y agoPlease don't do this here.
- aaaaaaass 8y agowhy, that is a valid question.
- deleted 8y ago[deleted]