Indeed. Array is an instance of Object (Array instanceof Object => true
). Since []
effectively calls an object constructor for a new Array each time, different objects (pointers) are compared. These types of discrepancies are exactly what libraries like http://underscorejs.org/ solve and explain.