Symbol.species Controls Constructor?!

Symbol.species is POWERFUL! It controls what constructor methods return. Your custom array methods return plain Array, not your subclass! This breaks inheritance!

#javascript #javascripttricks #symbol.species #constructorcontrol #subclassing #javascriptweird #javascriptquiz #codingchallenge #javascriptshorts #javascriptwtf #classinheritance #advancedjavascript

https://www.youtube.com/watch?v=3eq3XAas_pc

Symbol.species Controls Constructor?! #codingchallenge

YouTube