Why are there so many utilities of objects defined on the constructor rather than the prototype

In ES5, not many object utilities are defined for the constructor, and not a prototype (for example, definePropertyand keys). What are the reasons for choosing this design? It myObject.keys()seems to me a much better API thanObject.keys(myObject)

+4
source share

Source: https://habr.com/ru/post/1536913/


All Articles