Override image constructor in JS?

后端 未结 2 528
轮回少年
轮回少年 2021-01-19 11:05

Is it possible to override the Image constructor in JS? So that, for example, every time a new Image() is created, a message is written to the cons

2条回答
  •  遥遥无期
    2021-01-19 11:50

    Take a look at this link, it is possible to override constructors. However, I believe this is now what you want, you want to EXTEND it. Take a look at the "Extends ABC" part.

提交回复
热议问题