I am a beginner with lodash i went from c# and i have used LINQ sometimes, i have learned that lodash can be used to do query linq style, but despite my attempts, cant able to get index of the items, from array of objects that have a boolean property equal to true in lodash. Can anyone help me?
My first try :
var indexofItemns =_.find( arrayOfItems, (item) =>
(item.booleanProperty === true));
But, I have an array and i do:
var indexItems: number[] = [];
indexItems= _.times(
arrayOfItems.length,
_.find( arrayOfItems, (item) => (item.booleanProperty === true));
the second row does not compile neither.
Thanks