Created
November 29, 2017 15:33
-
-
Save courtneymyers/7d6a92e493291cc3909e4079654bef62 to your computer and use it in GitHub Desktop.
JavaScript utility functions
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
// helper function for initializing default values of an object's key | |
function init(object, key, fallback) { | |
(object[key] != null) ? object[key] : object[key] = fallback; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment