← Back to release summary

Array subclassing and Symbol.species support

Category
JavaScript
Type
New or changed feature
Status
Enabled by default (Chrome 51)
Intent stage
None

Summary

ES2015 changes the semantics of Arrays and certain other classes to create subclass instances from certain methods, and allow a new interception point, Symbol.species, to control whether it's actually the subclass or another class which is instantiated. For example, Array.prototype.map constructs instances of the subclass as its output, with the option to customize this by changing Symbol.species

Standards & signals

Docs: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/species

View on chromestatus.com