If we have an empty array in JavaScript then add a property to it, the property does seem to exist but the array has 0 length.
var arr = [];
arr.property = '1234';
console.log(arr); // []
console.log(arr.property); // "1234"
In NodeJs its slightly different
console.log(arr); // [ property: '1234' ]
Is this a valid condition for an array to be in?
I spotted this whilst reading the unit tests for the JS App I work in and wonder if the test is correct to check for this kind of thing.
Edit: My query was around whether or not its a valid condition rather than why the length isn't increased. I guess it is valid if it refers to the state of it in the spec.