📅  最后修改于: 2022-03-11 15:03:21.858000             🧑  作者: Mango
let string = ‘Alice’;
// padStart() — we assume our string needs to have 10 characters
string.padStart(10, ‘o’); // returns ‘oooooAlice’
// padEnd()
string.padEnd(10, ‘o’); // returns ‘Aliceooooo’;