javascript i++
,如何add 10
每次都做一些代码?
我需要 1,11,21,31,41,51,61,71,81,91。
for(i = 1; i < 100; i++) {
//I need 1,11,21,31,41,51,61,71,81,91
}
javascript i++
,如何add 10
每次都做一些代码?
我需要 1,11,21,31,41,51,61,71,81,91。
for(i = 1; i < 100; i++) {
//I need 1,11,21,31,41,51,61,71,81,91
}
采用:
for(i = 1; i < 100; i+=10) {
//I need 1,11,21,31,41,51,61,71,81,91
}
在每个循环中添加 10 个。
for(i = 1; i < 100; i +=10) {
//I need 1,11,21,31,41,51,61,71,81,91
}
像这样->
for(var i=1; i< 100; i=i+10) {
console.log(i);
}