If you monkey patch Array.prototype with negative indices, what’s the expected behavior of Array.prototype.indexOf? An index of -1 returned by that method means that the given item is not found in the array. You still have to have a way of representing the null case. But more importantly, -1 is so commonly understood to have this meaning that the benefits of breaking that behavior do not seem to justify the cost.
If you monkey patch Array.prototype with negative indices, what’s the expected behavior of
Array.prototype.indexOf? An index of-1returned by that method means that the given item is not found in the array. You still have to have a way of representing the null case. But more importantly,-1is so commonly understood to have this meaning that the benefits of breaking that behavior do not seem to justify the cost.Not to mention the performance implications of bringing Proxy into the situation.