Joined May 2017
·

anywhichway

·

Posted to Subclassing JavaScript's Array class over 1 year ago

Note this class ArrayWrapper extends Array is fully supported in the most recent versions of Chrome, Edge, and Firefox. Although, something akin to what you have provided is definitely needed for older browsers. A middle ground would be to use Proxies, which seem to pre-date Array inheritance support in Edge and Firefox. See https://medium.com/@anywhichway/array-sub-classing-with-support-461ff7c3b819.

Achievements
1 Karma
0 Total ProTip Views