|
|
|
|
|
by connor4312
1202 days ago
|
|
Because your example is a breaking change, and breaking changes are hard to make in a runtime that needs to reasonably support two decades worth of web content. For example, if you have a `binarySearch` function that returns -1 if an element isn't found, a developer might do something. `const result = arr[index]; if (result !== undefined) { ... }`. This would then start returning the last element instead of undefined at that index. |
|
But what do I care, whatever mess and complexity arises from these "good enough" implementations is left for the generation after us to deal with :)