Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upArray.prototype.findLastIndex() #1253
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
WebReflection
Jul 4, 2018
FWIW, indexOf => lastIndexOf so that findIndex => findLastIndex is the only name that makes sense to me.
However, reduce => reduceRight is also a thing so maybe findIndexRight would make sense too?
That leaves room for forEachRight, someRight, everyRight as well, so maybe it's a bit too much to ask :-)
WebReflection
commented
Jul 4, 2018
|
FWIW, However, That leaves room for |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
ljharb
Jul 4, 2018
Member
Maybe somebody can speak to any motivation for not adding it.
However, please see https://github.com/tc39/ecma262/blob/master/CONTRIBUTING.md for how to best suggest new features for the language.
|
Maybe somebody can speak to any motivation for not adding it. However, please see https://github.com/tc39/ecma262/blob/master/CONTRIBUTING.md for how to best suggest new features for the language. |
ljharb
closed this
Jul 4, 2018
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
teriyakigod2
commented
Jul 5, 2018
|
@ljharb Thx, my fault i didn't read it out before. |
teriyakigod2 commentedJul 4, 2018
•
edited
Why do we have
findIndexmethod, but no findLastIndex? It seems logical to follow[index|lastIndex]Of` pair, doesn't it? Reversing array to find the last element satisfies the condition seems too complicated to me.Example:
Would be glad to implement, if it makes sense.
Thx for replies.