JavaScript循环输出26个英文字母2种方法

方法一

var character = new Array("A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","X","Y","Z");
for(var i=0;i<25;i++)
{
alert(character[i]);
}


方法二

for(var i=0;i<25;i++)
{
alert(String.fromCharCode((65+i)));
}
 
js大小写转换
strVariable.toUpperCase( ) 转大写
stringVar.toLowerCase( ) 转小写

JavaScript循环输出26个英文字母2种方法,布布扣,bubuko.com

JavaScript循环输出26个英文字母2种方法

上一篇:python + wxPython + SPE资源下载


下一篇:Java常见面试题(含答案)