日期:2014-05-16 浏览次数:20353 次
var Person={name:'default name', getName:function(){ return this.name} } var reader=clone(Person); reader.name='张三'; alert(reader.getName())
function clone(obj){ var his=new Object(); for(var p in obj) { his[p]=obj[p]; } return his; }