News for hackers. Stuff that matters.
Re:Today’s JavaScript, from an outsider’s perspective (2020) by deergomoo on Saturday May 28, 2022 @07:53AM (#31539590)
> What other languages provide an equivalent to that?

https://www.php.net/manual/en/function.str-pad.php

https://docs.ruby-lang.org/en/3.1/String.html

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.

There are no comments on this comment yet.