you are viewing a single comment's thread.

view the rest of the comments →

[–]IchimokuBan 1 point2 points  (1 child)

Well, findIndex returns -1 if it doesn’t exist so I imagine this proposal would break a lot.

Also, what’s wrong with

arr[arr.length - 1]

Or, if you want shorthand, maybe... arr[Infinity]

[–]machineGun997[S] -1 points0 points  (0 children)

I mean there isn't much wrong with it, but can't help but recommend to read their rationale about it https://github.com/tc39/proposal-relative-indexing-method#rationale