JavaScript Professional — Hard
Key points
- Symbol.hasInstance allows customizing instanceof behavior
- MyArray class extends Array and defines Symbol.hasInstance method
- The method returns true for arrays, making [] an instance of MyArray
Ready to go further?
Related questions
