Use of the Object.__proto__ setter should be avoided

Published: | Categories: JavaScript


Mutating the prototype of an object, using either Object.__proto__ or Object.setPrototypeOf, is strongly discouraged because the operation is very slow. While Internet Explorer 11 added the support of Object.__proto__ for interoperability, this property has been deprecated and should not be used. Firefox 30 and later warns the usage of the Object.__proto__ setter when the JavaScript strict warning is enabled. As described in the documents, the Object.create method should be used instead to create an object with a desired prototype.