I am new to using lodash after transitioning from C# where I occasionally used LINQ. I have discovered that lodash can be utilized for querying in a LINQ-style manner, but I'm struggling to retrieve the indexes of items in an array of objects with a boolean property set to true using lodash. Can anyone offer some assistance?
My initial attempt:
var indexOfItems = _.find(arrayOfItems, (item) =>
(item.booleanProperty === true));
However, when I try:
var indexItems: number[] = [];
indexItems = _.times(
arrayOfItems.length,
_.find(arrayOfItems, (item) => (item.booleanProperty === true));
The second line doesn't compile either.
Thank you!