码迷,mamicode.com
首页 > Web开发 > 详细

JS 对象遍历

时间:2016-09-13 22:27:00      阅读:190      评论:0      收藏:0      [点我收藏+]

标签:


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 对象遍历

标签:

原文地址:http://www.cnblogs.com/cocoat/p/5869927.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!