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]); } }

 

posted @ 2016-09-13 21:54  旋转的梦  阅读(1826)  评论(0编辑  收藏  举报