Created
April 9, 2021 09:13
-
-
Save IKatsuba/ebdac16da840be9762eb1d6cbbb926a4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const items = [1, 2, 3, 4]; | |
//before | |
const index = items.reverse().findIndex(fn); // the reverse method mutates the array | |
//after | |
const index = items.findLastIndex(fn); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment