📅  最后修改于: 2022-03-11 14:57:20.939000             🧑  作者: Mango
function accum(s) {
var letters = s.split(''), words = [];
for(var i = 0; i < letters.length; i++) {
words.push(letters[i].toUpperCase() + Array(i + 1).join(letters[i].toLowerCase()));
}
return words.join('-');
}