5 ms·
Given how many front-end packages are on NPM, it's obviously not the case that the libraries provided were sufficient for scripting the DOM. Just take left_pad
by jdminhbg 4y ago
Given how many front-end packages are on NPM, it's obviously not the case that the libraries provided were sufficient for scripting the DOM. Just take left_pad itself, that's something the language should provide, and it's an issue that it ended up being a point of failure.
I have no particular love for using JS as a language to power everything from IoT devices to web servers, but it doesn't really matter how I feel about it. It's not going anywhere.
- krapp 4y ago>Just take left_pad itself, that's something the language should provide, and it's an issue that it ended up being a point of failure. Why should the language provide that? What other languages provide an equivalent to that? left_pad is intended for formatting text within a terminal, not a website. There's no need for it within the context of a website, because HTML has tables, CSS and other elements for that.
- deergomoo 4y ago> What other languages provide an equivalent to that? https://www.php.net/manual/en/function.str-pad.php https://www.php.net/manual/en/function.str-pad.php https://docs.ruby-lang.org/en/3.1/String.html https://docs.ruby-lang.org/en/3.1/String.html https://developer.apple.com/documentation/foundation/nsstring/1416395-padding https://developer.apple.com/documentation/foundation/nsstrin... > left_pad is intended for formatting text within a terminal, not a website. There's no need for it within the context of a website This is just not correct. It’s for padding a string with any character, for example adding leading zeroes to a number for display purposes. There are plenty of reasons to want to do that in a browser.