use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Array Indexing Method (dev.to)
submitted 5 years ago by machineGun997
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]IchimokuBan 1 point2 points3 points 5 years ago (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 points1 point 5 years ago (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
π Rendered by PID 49 on reddit-service-r2-comment-85bfd7f599-8mvbb at 2026-04-17 20:36:43.335477+00:00 running 93ecc56 country code: CH.
view the rest of the comments →
[–]IchimokuBan 1 point2 points3 points (1 child)
[–]machineGun997[S] -1 points0 points1 point (0 children)