lists-lastindexof

Get last index of value in lists, like Array.lastIndexOf().

Usage no npm install needed!

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

README

lists-lastindexof

NOTE: lists-lastindexof was renamed to @extra-lists/last-index-of. NPM

Get last index of value in lists, like Array.lastIndexOf().

const lastIndexOf = require('lists-lastindexof');
// lastIndexOf(<lists>, <search value>)

a = ['brothers', 'brothers', 'brothers'];
lastIndexOf([a.keys(), a], 'brothers');
// 2
a = {w1: 'friends', w2: 'romans', w3: 'countrymen'};
lastIndexOf([Object.keys(a), Object.values(a)], 'romans');
// 'w2'