首页 > 代码库 > JS 对象遍历

JS 对象遍历

var orgRoot = {    271: {backgroundColor: ‘#f68f2b‘, textColor: ‘#FFFFFF‘},    272: {backgroundColor: ‘#49a9f3‘, textColor: ‘#FFFFFF‘},    273: {backgroundColor: ‘#78c06e‘, textColor: ‘#FFFFFF‘},    274: {backgroundColor: ‘#f68f2b‘, textColor: ‘#FFFFFF‘},    275: {backgroundColor: ‘#49a9f3‘, textColor: ‘#FFFFFF‘}};
var orgs = [];
for
( var p in orgRoot ){ if ( typeof ( orgRoot [ p ]) == " function " ){ } else { orgs.push(orgRoot [p]); } }

 

JS 对象遍历