Is there any way to convert regular array into lazy enumerable? I want the code below produces only one log, not ten ones:
const items = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
items.map((i) => {
console.log('expensive process');
return i;
})
.findIndex((i) => true);