vendredi 27 décembre 2019

All objects in JavaScript are descended from Object why, for which purpose? [closed]

I know JavaScript is prototype based programming. It has only object. Creation of object is costly so we use object as prototype. I understand it gives hierarchy(links) for inheritance, from Object(global) for objects. but why there is one global object(Object)? What purpose does it achieve? Why such design?

Aucun commentaire:

Enregistrer un commentaire