Created
June 9, 2021 19:09
-
-
Save 64lines/5af983e9090013e86aad94a61da439eb to your computer and use it in GitHub Desktop.
Functional if then else statement
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
/** Functional If Then Else **/ | |
const condition = ({ If, Then, Else }) => If ? Then : Else | |
condition({ | |
If: true, | |
Then: () => { | |
console.log(`That is true`) | |
}, | |
Else: () => { | |
console.log(`That is NOT true`) | |
} | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment