Created
March 1, 2026 18:08
-
-
Save davidystephenson/7a19317354e316e912d5b72b79999a61 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 bakeryVan = { | |
| destination: 'bakery', | |
| cargo: 5 | |
| } | |
| const schoolVan = { | |
| destination: 'school', | |
| cargo: ['Dorothy', 'Zelda', 'Tallulah'] | |
| } | |
| function deliver (van) { | |
| console.log('Delivery arrived at', van.destination) | |
| return van.cargo | |
| } | |
| function receiveBags (bags) { | |
| console.log(bags, 'bags received') | |
| } | |
| function receivePassengers (passengers) { | |
| const joined = passengers.join(', ') | |
| console.log('Passengers received:', joined) | |
| } | |
| const bakeryDelivery = deliver(bakeryVan) | |
| receiveBags(bakeryDelivery) | |
| const schoolDelivery = deliver(schoolVan) | |
| receivePassengers(schoolDelivery) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
note to self:
my task is to think of (and maybe write down) the TS code that would transpile into this JS fragment