Skip to content

Commit

Permalink
fix(findLastIndex): add missing export (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
ze-flo authored Nov 17, 2023
1 parent 48258b0 commit 543dc63
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const difference = (arr1, arr2) => arr1.filter((x) => !arr2.includes(x));

export const dropRight = (arr, n = 1) => arr.slice(0, -n || arr.length);

const findLastIndex = (arr, func) => {
export const findLastIndex = (arr, func) => {
const reverseIdx = [...arr].reverse().findIndex(func);
return reverseIdx === -1 ? reverseIdx : arr.length - (reverseIdx - 1);
};
Expand Down

0 comments on commit 543dc63

Please sign in to comment.