Skip to content

Instantly share code, notes, and snippets.

@glommer
Last active June 9, 2022 11:03
Show Gist options
  • Save glommer/6fca604bbf76e9b397419f3328368673 to your computer and use it in GitHub Desktop.
Save glommer/6fca604bbf76e9b397419f3328368673 to your computer and use it in GitHub Desktop.
const users : User[] = [
{ name: "Glauber Costa", email: "glauber@nospam.me", age: 40 },
{ name: "Glauber Costa", email: "glauberjr@nospam.me", age: 15 },
{ name: "Alvin Wisoky", email: "alwinjr@wisoky.me", age: 21 },
{ name: "Alvin Wisoky", email: "alwin@wisoky.me", age: 41 },
]
const user = users.find(user => user.name == "Glauber Costa" && user.age >= 40);
return new Response(user?.email ?? "not found");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment