js简单的创建包含26个英文字母的数组

-

let a = Array.from(new Array(26), (val, index) => String.fromCodePoint(65 + index));
console.log(a)
let b = new Array(26).fill(1).map((val,index) => String.fromCodePoint(65+index))
console.log(b)

 

 

 

 

 

-

posted @ 2024-07-23 22:32  古墩古墩  Views(7)  Comments(0Edit  收藏  举报