Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
isHotdog
let prop = new Proxy({}, { get: (_, name) => (obj) => obj[name] });
let foods = [
{ name: 'hotdog', isHotdog: true },
{ name: 'pizza', isHotdog: false },
{ name: 'spaghetti', isHotdog: false }
];
console.log(foods.map(prop.name));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.