code not working and compiler says "ReferenceError: range is not defined"
code is copied from this famous book:https://eloquentjavascript.net/05_higher_order.html#c_EiK2Y8M/Mh code:
function repeat(n, action) {
for (let i = 0; i < n; i++) {
console.log(action(...range(0, i)));
}
}
repeat(5, Math.max);
I tried let range = new Range(); but it wasn't working