Last active
October 15, 2019 08:08
-
-
Save JaySunSyn/8959f992b68a6f3256abff1239a48001 to your computer and use it in GitHub Desktop.
medium-null-example-one-solution
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
function when(expression, trueFn, falseFn) { | |
if (expression != null) { | |
return trueFn(); | |
} | |
if (falseFn != null) { | |
return falseFn(); | |
} | |
return undefined; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment