首页 > 技术文章 > 生成26个字母

yinhao-jack 2020-08-05 15:32 原文

const alphabet=Array.from(new Array(26),(ele,index)=>{
    return String.fromCharCode(65+index);
})
  console.log(alphabet)
//["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"]

  

推荐阅读