标签:var while i++ 打印 log pre == console for
===============for ,while 打印 1 到100的和
<script>
var i=1;
var JG=0;
while (i<101){
JG+=i;
i++;
}
console.log(‘while结果‘,JG);
var n;
var JG2=0;
for (n=1;n<101;n++)
{
JG2+=n;
}
console.log(‘for 结果‘,JG2)
</script>
标签:var while i++ 打印 log pre == console for
原文地址:http://www.cnblogs.com/onda/p/7259297.html