I'm messing around in console and saw the following:
>>> []
[]
>>> Array.prototype
[]
>>> [] == Array.prototype
false
>>> [] === Array.prototype
false
Can anyone explain this behavior? (Sounds like a good candidate for wtfjs)
In Javascript, == on arrays is pointer equality, ie only true if the both arrays are the same object. If arrays aren't pointer equal, then storing to one won't affect the other.
>>> typeof [] == typeof Array.prototype
true
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With