JavaScript overwrite prototype method

后端 未结 0 719
抹茶落季
抹茶落季 2021-01-28 04:36

Consider the following code:

class X {
  pop() { return \'ORIGINAL\'; }
}

const x = new X();

x.pop(); // \'ORIGINAL\' via prototype lookup

x.pop = () => \'N         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题