This is in Chromium 78:
for (var i in [1,3,5]) console.log(i+1)
Now, I expected for (var i in [1,3,5]) console.log(i+1) to output 1, 2, 3, because i should be an index value. I know the MDN docs mention that the order may come out strangely in this case, but why the type conversion?

for...inreturns a string key. Also: Why is using “for…in” with array iteration a bad idea?for...inshould not be used to iterate over an Array where the index order is important"for ... inis, that unlike many other methods (e.g.Object.keys), it iterates the prototype chain aswell. Therefore, e.g.Array.prototype["surprise!"] = 1; for (let p in []) console.log(p);may be "surprise!"'ing.