Yields every item in eventsByEnd that has the specified end value. Return item is a wrapped object consisting of the event as well as its index.
eventsByEnd
end
The function expects that the input array has been sorted using sortByEnd, and therefore sorted by ascending end value.
const events = [ { start: 1, end: 2}, { start: 5, end: 10 }, { start: 10, end: 12 }];const matched = [...itemsWithEnd(events, 10)];// matched is [{ event: { start: 5, end: 10 }, index: 1 }] Copy
const events = [ { start: 1, end: 2}, { start: 5, end: 10 }, { start: 10, end: 12 }];const matched = [...itemsWithEnd(events, 10)];// matched is [{ event: { start: 5, end: 10 }, index: 1 }]
Events sorted with sortByEnd
End position
Yields every item in
eventsByEndthat has the specifiedendvalue. Return item is a wrapped object consisting of the event as well as its index.The function expects that the input array has been sorted using sortByEnd, and therefore sorted by ascending end value.