Subclassing ECMAScript arrays with Array.create(arrayPrototypeObject)
# Axel Rauschmayer (13 years ago)
Check out http://wiki.ecmascript.org/doku.php?id=harmony:object_literals#set_literal_prototype_operator On May 21, 2012, at 18:23 , Henri Manson wrote: > I would like to propose a built-in method Array.create(arrayPrototypeObject) which would create a new array with arrayPrototypeObject as it's prototype. > > Other posts already mention Array.create such as https://mail.mozilla.org/pipermail/es-discuss/2009-December/010425.html and a describing article http://perfectionkills.com/how-ecmascript-5-still-does-not-allow-to-subclass-an-array/ > > Maybe there is a ES.next feature which allows subclassing javascript arrays in another way then mentioned above? > > Regards, > > Henri > > _______________________________________________ > es-discuss mailing list > es-discuss at mozilla.org > https://mail.mozilla.org/listinfo/es-discuss -- Dr. Axel Rauschmayer axel at rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120521/0d86b50f/attachment-0001.html>
I would like to propose a built-in method Array.create(arrayPrototypeObject) which would create a new array with arrayPrototypeObject as it's prototype.
Other posts already mention Array.create such as esdiscuss/2009-December/010425 and a describing article perfectionkills.com/how-ecmascript-5-still-does-not-allow-to-subclass-an-array
Maybe there is a ES.next feature which allows subclassing javascript arrays in another way then mentioned above?
,
Henri