Why is the Temp.prototype on the MDN Object.create polyfill set to null?

后端 未结 2 1103
余生分开走
余生分开走 2021-01-07 04:10

Why does the MDN polyfill for Object.create have the following line:

Temp.prototype = null;

Is it so that we avoid maintaining a reference

2条回答
  •  清歌不尽
    2021-01-07 05:00

    I think this is just clean, Temp.prototype is kind of static, since it is set before new Temp() it is nice to clean it after.

提交回复
热议问题