chore: array fill (#8263)
This commit is contained in:
@@ -41,12 +41,10 @@ export type IndexBarProvide = {
|
||||
};
|
||||
|
||||
function genAlphabet() {
|
||||
const indexList = [];
|
||||
const charCodeOfA = 'A'.charCodeAt(0);
|
||||
|
||||
for (let i = 0; i < 26; i++) {
|
||||
indexList.push(String.fromCharCode(charCodeOfA + i));
|
||||
}
|
||||
const indexList = Array(26)
|
||||
.fill('')
|
||||
.map((_, i) => String.fromCharCode(charCodeOfA + i));
|
||||
|
||||
return indexList;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user