1 回答
已采纳
stone310
TA贡献361条经验 获得超191个赞
var x = {
a: 1,
b: { //b不会被遍历
y: 1,
z: 2
},
c: [1, [3, 4]],
d: function () {
},
e: null,
f: "123",
g: undefined,
h: false
};
for (var i in x) {
if (Object.prototype.toString.apply(x[i]) !== '[object Object]') {
console.log(x[i])
};
}添加回答
举报
0/150
提交
取消
