Skip to content

Instantly share code, notes, and snippets.

@Javiani
Created July 21, 2019 01:00
Show Gist options
  • Save Javiani/ade3e032d7dc43448a1c09074feb566d to your computer and use it in GitHub Desktop.
Save Javiani/ade3e032d7dc43448a1c09074feb566d to your computer and use it in GitHub Desktop.
Snippets for Medium
const lastname = Maybe(() => data.personsLastName[1].value)
.catch( _ => 'Lastname' )
const fullname = firstname
.then( fname => middleName.then( mname => `${fname} ${mname}`) )
.then( name => lastname.then( lname => `${name} ${lname}` ) )
// 'Marcus Geoffrey Lastname'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment