3 ms·or const leftpad = (str, len, char = ' ') => str.padStart(len, char);by easrng 5y agoor const leftpad = (str, len, char = ' ') => str.padStart(len, char);beaconstudios 5y agoHaha yes that would be the modern option.