求助!?。。?!在線等急?。。?!
var forest={};
?Object.defineProperties(forest,{
? title:{value:'fe',enumerable:true},
? corp:{value:'BABA',enumerable:true},
? salary:{value:'50000',enumerable:true,writable:true},
? luck:{
? get:function(){
? return Math.random()>0.5?'good':'bad';
? }
? },
? promote:{
? set:function(level){
? this.salary*=1+level*0.1;
? }
? }
?});
?forest.salary;
這個代碼在Sublime怎么執行?
而且會報錯
Uncaught TypeError: forest.promote is not a function
? ? at 標簽屬性.html:37
2017-06-28
復制過來沒錯啊。。。。