Introduction
type User = { name: string; address: string };
type Address = { city: string; streetNumber: number; owner: User };
const parseAddress = (address: string): Address => { /* Does parsing */ }
// Assume we have a list of 100 users from the database.
const users: User[] = [ user1, user2, user3, ..., user99, user100 ];
// Parse the data and find the users who live in my hometown.
const neighbor = users
.map(user => parseAddress(user.address))
.filter(address => address.city === "My Hometown")
.map(address => address.owner)[0];Infinite sequences
Realization
Integration with non-lazy JavaScript
Common usage
Benchmarks
Best case (first item is all we need).
approach
ops per second
middle case (we need to search half the space).
approach
ops per second
Worst Case (we search the entire space)
approach
ops per second
Prior Art
License
Last updated
Was this helpful?