0.1.3 • Published 6 years ago
lists-lastindexof v0.1.3
lists-lastindexof
NOTE: lists-lastindexof was renamed to @extra-lists/last-index-of.
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'