The "everything is an object" approach is takes is such a double edged sword. On one hand it's nice to use index access for objects but typeof [] being object is just silly if you're coming from another language.
I had a stubborn bug where an array was refusing to be identified by Array.isArray in my code yet if I tried it in the console it would work. Even recreating it by inserting it into a blank array using spread syntax like [...myArray] still failed the isArray test :/
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
The "everything is an object" approach is takes is such a double edged sword. On one hand it's nice to use index access for objects but
typeof []
being object is just silly if you're coming from another language.I had a stubborn bug where an array was refusing to be identified by
Array.isArray
in my code yet if I tried it in the console it would work. Even recreating it by inserting it into a blank array using spread syntax like[...myArray]
still failed the isArray test :/