r/ProgrammerAnimemes • u/bucket3432 • Jan 30 '20
OC Dependencies
Enable HLS to view with audio, or disable this notification
1.6k
Upvotes
r/ProgrammerAnimemes • u/bucket3432 • Jan 30 '20
Enable HLS to view with audio, or disable this notification
View all comments
Show parent comment
12
u/bucket3432 Jan 31 '20
Zero-padding numbers to be a certain width comes to mind. You might even space-pad it if your application is running in Node and your output is to a terminal. But it's only useful if your environment doesn't support
String.prototype.padStartand you really don't want to write it yourself.