我正在使用$.each
函数循环一个对象,但我得到了不确定的值。
我的代码有什么问题?
var mainPageCircle = {
circles: {
c1: {
color: '#730000',
text: 'Content'
},
c2: {
color: '#004f74',
text: 'Consulting'
},
c3: {
color: '#146c00',
text: 'Commerce'
}
},
radious: 100,
stroke: 10,
strokeColor: '#fff',
opacity: 0.7
}
$.each(mainPageCircle, function(key, value) {
var circles = value.circles,
radious = value.radious;
$.each(circles, function(index, c) {
console.log(index, c); // i am getting error; i need index should be 0,1,2 and c should be : c1,c2,c3 values
})
})