Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save davidystephenson/7a19317354e316e912d5b72b79999a61 to your computer and use it in GitHub Desktop.

Select an option

Save davidystephenson/7a19317354e316e912d5b72b79999a61 to your computer and use it in GitHub Desktop.
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)
@nikpushkarski
Copy link

note to self:

my task is to think of (and maybe write down) the TS code that would transpile into this JS fragment

@nikpushkarski
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment