Created
January 11, 2026 17:08
-
-
Save davidystephenson/5912c21c638ad11eb12f6904cf6ab9c2 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| const theHobbit = { | |
| author: 'Tolkien', | |
| protagonist: 'Bilbo', | |
| pages: 300 | |
| } | |
| const watchmen = { | |
| author: 'Moore', | |
| protagonist: 'Rorschach', | |
| pages: 450 | |
| } | |
| function describeBook (book, key) { | |
| const value = book[key] | |
| console.log('The', key, 'of this book is', value) | |
| } | |
| describeBook(theHobbit, 'author') | |
| describeBook(watchment, 'pages') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment