var a = { name: ' warm ', age: ' 8 ' };
var b = {};
for( attr in a) {
console.log( attr + ' : ' + a[ attr ] )
b[ attr ] = a[ attr ]
}
var a = { name: ' warm ', age: ' 8 ' };
var b = {};
for( attr in a) {
console.log( attr + ' : ' + a[ attr ] )
b[ attr ] = a[ attr ]
}
本文标题:js-对象的遍历和克隆
本文链接:https://www.haomeiwen.com/subject/kzhgrxtx.html
网友评论