var legend=[{"min":0,
"max":first_color,
"color":"#1a9850"
},
{
"min":first_color,
"max":sec_color,
"color":"#fee08b"
},
{
"min":sec_color,
"max":thrd_color,
"color":"#ff3300"
},
{
"min":thrd_color,
"max":frth_color,
"color":"#d73027"
"Abc":"gsfg"
}
];
我想知道每個對象的屬性數。例如。前3個對象有3個屬性,第4個對象有4個道具等。如何查找JSON對象的長度
這不是JSON;這是一個JavaScript數組。 – Biffen
1.迭代2.獲取數組3中的當前元素。'Object.keys(arrayEl).length' – Tushar
你可以發佈你的代碼嗎?新的js –