Last active
January 31, 2018 10:12
-
-
Save luan0ap/c55349e8a7cf1b309d68a86ab39a2712 to your computer and use it in GitHub Desktop.
Use functions as conditional
This file contains 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 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