js 的for
文章目录
js原生的for语法
1.
for(let i=0,i<xxxx.legth,i++){
}2.
for语法2: index 代表下标
for(let index in data){
console.log("测试for循环")
let user = data[index];
alert(user.name);
}3.
for语法3: user当前循环遍历的对象
for(let user of data){
console.log("for循环测试:"+user.name);
}
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论