Skip to content

Instantly share code, notes, and snippets.

@64lines
Created June 9, 2021 19:09
Show Gist options
  • Save 64lines/5af983e9090013e86aad94a61da439eb to your computer and use it in GitHub Desktop.
Save 64lines/5af983e9090013e86aad94a61da439eb to your computer and use it in GitHub Desktop.
Functional if then else statement
/** 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