lodash/lodash — pull request #798 by evgenyboxer (2014-11-26 12:57:19+00:00)
Title: Add a spec to catch the iOS8 / iPhone6 / Safari bug

I have encountered a very strange bug which seems to happen only in iPhone6 (iOS8) running Safari browser.

Consider the following code: ( you can also test the jsfiddle: http://jsfiddle.net/evgenyboxer/rcsz27v1/1/ )

```
var numOfIterations = 10000;
var counter = 0;
var obj = {
1: 'foo',
8: 'bar',
50: 'baz'
};

var expectedCounter = 3;

for (var i = 0; i < numOfIterations; i++) {
_.filter([], function() { return true; });
}

_.filter(obj, function() {
counter++;
return true;
});

if (counter !== expectedCounter) {
alert('Incorrect number of iterated keys: ' + counter);
} else {
alert('Correct number of iterated keys: ' + counter)
}
```

Shockingly the output for iPhone6 is **51** and not **3** as expected.
Why is it **51**? well, it takes the highest key ( which is **50** ) and adds 1 to it.
If you add a new key with higher value ( such as **1000** ) the output will be **1001**

If you change the "numOfIterations" to say **10** ``` var numOfIterations = 10``` the problem will **NOT** occur.
The theory behind this problem might be optimisations performed by the nitro javascript engine. Again, just a theory.

The problem reproduces in lodash 2.4.1 ( modern build ), but isn't reproduced in Edge / Compat mode.