Last active
April 29, 2021 11:31
-
-
Save joshuacerbito/842735a299ed9dcb2a5eca33337cc803 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
/** | |
* Return the value if the conditional provided passes. | |
* | |
* @param {Boolean} conditional | |
* @param {*} template | |
*/ | |
export const when = (conditional, thing, output = null) => !!conditional ? thing : output; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment