lists-findlastindex

Get index of last value in lists that satisfies the test, like Array.findIndex().

Usage no npm install needed!

<script type="module">
  import listsFindlastindex from 'https://cdn.skypack.dev/lists-findlastindex';
</script>

README

lists-findlastindex

NOTE: lists-findlastindex was renamed to @extra-lists/find-last-index. NPM

Get index of last value in lists that satisfies the test, like Array.findIndex().

const findLastIndex = require('lists-findlastindex');
// findLastIndex(<lists>, <test function>, [this])

a = ['syntax', 'description', 'examples'];
findLastIndex([a.keys(), a], (v) => v.includes('x'));
// 2
a = {t1: 'polyfill', t2: 'specifications', t3: 'compatibility'};
findLastIndex([Object.keys(a), Object.values(a)], (v, i, lst) => i.includes('2'));
// 't2'