Closed rtfeldman closed 9 years ago
Immutable(["foo", "bar"]).flatMap(function(val, index) { return "index is " + index + " aaaand its type is " + (typeof index); }); // [ 'index is 0 aaaand its type is string', 'index is 1 aaaand its type is string' ]
The offending line of code: https://github.com/rtfeldman/seamless-immutable/blob/master/src/seamless-immutable.js#L124
Evidence suggests that second argument needs to be parseInt(key) which is absolutely gobsmacking.
parseInt(key)
This is now fixed more efficiently by https://github.com/rtfeldman/seamless-immutable/commit/af6a8dfd7e2f1939e5108aae118b9270cb9bff3a
The offending line of code: https://github.com/rtfeldman/seamless-immutable/blob/master/src/seamless-immutable.js#L124
Evidence suggests that second argument needs to be
parseInt(key)
which is absolutely gobsmacking.