In underscore, I can successfully find an item with a specific key value
var tv = [{id:1},{id:2}] var voteID = 2; var data = _.find(tv, function(voteItem){ r
The simplest solution is to use lodash:
npm install --save lodash
const _ = require('lodash');
findIndexByElementKeyValue = (elementKeyValue) => { return _.findIndex(array, arrayItem => arrayItem.keyelementKeyValue); }