UNPKG

fabric

Version:

Object model for HTML5 canvas, and SVG-to-canvas parser. Backed by jsdom and node-canvas.

12 lines (11 loc) 274 B
export const findIndexRight = <T>( array: T[], predicate: (value: T, index: number, array: T[]) => boolean, ) => { for (let index = array.length - 1; index >= 0; index--) { if (predicate(array[index], index, array)) { return index; } } return -1; };