Arrow functions don’t bind this, so attempting to access it in an arrow function is going to error.
Eg this.length – this is undefined (or is whatever this happens to be in the scope you run your function), so it probably doesn’t have a length.
Arrow functions aren’t just “the new way of writing functions”, they’re a syntax for anonymous functions and they work slightly differently, they aren’t a 1-to-1 replacement. In this case you want a function defined using the function keyword because you need it to have its own this context.
Edit: Compare with when you call your method, for example:
[1,2,3].myMap((num) => num * 2)
The callback is an arrow function, that’s no problem: it takes a number and returns that number multiplied by 2, no this or anything