I want to get the index of the given value inside a Array using underscore.js.
Here is my case
var array = [{\'id\': 1, \'name\': \'xxx\'},
_.find(array, function(item, index) { if (item.id == searchValue.id) { alert(index); } });