learnrx
learnrx copied to clipboard
Invalid implementation of map in Lesson 4 will break code navigation
CodeMirror checks for and uses map on Array.prototype if it is defined. see it on codemirror.js L7213
function map(array, f) {
var out = [];
for (var i = 0; i < array.length; i++) out[i] = f(array[i], i);
return out;
}
if ([].map) map = function(array, f) { return array.map(f); };
solvable by commenting out/removing line 7213
function map(array, f) {
var out = [];
for (var i = 0; i < array.length; i++) out[i] = f(array[i], i);
return out;
}
- if ([].map) map = function(array, f) { return array.map(f); };
could you submit this as a PR