More clear intention, prevent mistake like this
bar = '12345';
'0'.repeat(4 - bar.length) + bar;
VM433:2 Uncaught RangeError: Invalid count value
at String.repeat (<anonymous>)
bar = '12345';
bar.padStart(4, '0');
'12345'
const foo = ' '.repeat(10 - bar.length) + bar;
const foo = '*'.repeat(10 - bar.length) + bar;
const foo = bar + ' '.repeat(10 - bar.length);
const foo = bar + '*'.repeat(10 - bar.length);
const foo = ('*'.repeat(10) + bar).slice(-10);
const foo = (bar + '*'.repeat(10)).slice(0, 10);
const foo = bar.padStart(10)
const foo = bar.padStart(10, '*')
const foo = bar.padEnd(10)
const foo = bar.padEnd(10, '*')
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too