"MyArray" - Custom Javascript Array implementation
Methods added
- push & pop
- forEach
- indexOf && lastIndexOf
- map && filter
- join
- shift && unshift
- reverse
- reduce
Additional implementations
- Constructing array by passing arguments like
MyArray(1, 2, 3)
range
static method to create arrays from given start and end points(works similar to one in Python)
Plans:
- Add
shuffle
method that shuffles the array elements - Update the length when elements are added using
arr[5] = "hello"
Feel free to contribute!