Skip to content

Instantly share code, notes, and snippets.

@luan0ap
Last active January 31, 2018 10:12
Show Gist options
  • Save luan0ap/c55349e8a7cf1b309d68a86ab39a2712 to your computer and use it in GitHub Desktop.
Save luan0ap/c55349e8a7cf1b309d68a86ab39a2712 to your computer and use it in GitHub Desktop.
Use functions as conditional
const conditional = () => ({
conditionOne: 'result',
conditionTwo: 'result'
})
conditional()['conditionOne'] || 'default value'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment