Created
January 11, 2026 17:20
-
-
Save davidystephenson/fcea30beee18c014c7f56dec0122e5d9 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 alpha = { | |
| budget: 63000000, | |
| director: 'Wachowskis', | |
| title: 'The Matrix' | |
| } | |
| const beta = { | |
| budget: 7200000, | |
| director: 'Coppola', | |
| title: 'The Godfather' | |
| } | |
| function analyzeMovie (movie, key) { | |
| const value = movie[key] | |
| console.log('The', key, 'of', movie.title, 'is', value) | |
| return value | |
| } | |
| function formatString (value) { | |
| const formatted = value.toUpperCase() | |
| console.log(formatted) | |
| } | |
| function formatNumber (value) { | |
| const formatted = value.toFixed(2) | |
| console.log(`$${formatted}) | |
| } | |
| const budget = analyzeMovie(alpha, 'budget') | |
| formatNumber(budget) | |
| const director = analyzeMovie(beta, 'director') | |
| formatString(director) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment