87,993
社区成员
发帖
与我相关
我的任务
分享
var arr=[1,2,3];
Object.defineProperty(arr,'0',{
set:function(newValue)
{
console.log('change');
this.value=newValue
},
get:function()
{
return this.value
}
})
//arr[0]=1
//输出change