Skip to content

Instantly share code, notes, and snippets.

@IKatsuba
Created April 9, 2021 09:13
Show Gist options
  • Save IKatsuba/ebdac16da840be9762eb1d6cbbb926a4 to your computer and use it in GitHub Desktop.
Save IKatsuba/ebdac16da840be9762eb1d6cbbb926a4 to your computer and use it in GitHub Desktop.
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