怎么用JS循环取到array里面的值啊
vararr=[{"a":"1","b":"2","c":"3"},{"a":"12","b":"22","c":"32"},{"a":"13","b":"23","c"...
var arr=[ {"a":"1","b":"2","c":"3"}, {"a":"12","b":"22","c":"32"},{"a":"13","b":"23","c":"33"}]
展开
2个回答
展开全部
var arr=[ {"a":"1","b":"2","c":"3"}, {"a":"12","b":"22","c":"32"},{"a":"13","b":"23","c":"33"}];
for(var i=0;i<arr.length;i++){
console.log(arr[i])
}
输出:
Object {a: "1", b: "2", c: "3"}
Object {a: "12", b: "22", c: "32"}
Object {a: "13", b: "23", c: "33"}
接下来就好做了
arr[i].a会取出 1,12,13
b和c同理
for(var i=0;i<arr.length;i++){
console.log(arr[i])
}
输出:
Object {a: "1", b: "2", c: "3"}
Object {a: "12", b: "22", c: "32"}
Object {a: "13", b: "23", c: "33"}
接下来就好做了
arr[i].a会取出 1,12,13
b和c同理
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询