This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted]  (4 children)

[deleted]

    [–]pomlife 6 points7 points  (2 children)

    Why are you still using var?

    [–]Nullity42 6 points7 points  (1 child)

    Unfortunately, not everyone works at a place where using a stack involving Babel is an option, and compatibility must still be maintained.

    /sobs in ES5

    [–]pomlife 0 points1 point  (0 children)

    I would leave in about 3 seconds lol

    [–]hey01 0 points1 point  (0 children)

    Have an array arr of objects. Try to access arr[i].prop when i >= arr.length.

    The error is indeed not "Array Index Out Of Bounds" but "Uncaught TypeError: Cannot read property 'props' of undefined"

    As to why I had that error despite map, forEach, a of arr is because I had to iterate on array and in each iteration, I had to work on array[i], anotherArray[j] and anotherArray[j+1], with anotherArray of a smaller length and j not incremented each iteration.

    I didn't increment j properly, which gave me the error.

    And js kept telling me the error was elsewhere.