1.1.1 • Published 5 years ago

@extra-lists/last-index-of v1.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

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

const lastIndexOf = require('@extra-lists/last-index-of');
// 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'

extra-lists