- 循环打印26英文字符
var strVariable; for(var i=0;i<25;i++) { console.log(String.fromCharCode((65+i))); } strVariable.toUpperCase( ); //转大写 strVariable.toLowerCase( ); //转小写
//字符转ascii码:用charCodeAt();
//ascii码砖字符:用fromCharCode();
//大写字母A 到Z 的值是从65 到90;
//小写a到z 是从91 到 122;
//如:
str="A";
code = str.charCodeAt();//65
str2 = String.fromCharCode(code);//A
str3 = String.fromCharCode(0x60+26);//Z