Created
October 6, 2020 05:19
-
-
Save sbussard/cc46a4f16bbaf892d4a666ca7f105d04 to your computer and use it in GitHub Desktop.
isHotdog
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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