function normalize(arr) {arr = arr.map((x)=>x.toLowerCase());
arr = arr.map((x)=>{
console.log(typeof x[0]);
x[0] = x[0]-32; //将首字符变大写
console.log(x[0]);
return x});
return arr;
}
normalize(['adam', 'LISA', 'barT']).toString();

C里经常用S[0] = S[0] +/- 32来转换大小写。
js似乎不行?
哈士奇WWW
红颜莎娜
随时随地看视频慕课网APP
相关分类