Created
July 16, 2019 14:45
-
-
Save iandesj/c92574ca78b916c76cefc937c628bea9 to your computer and use it in GitHub Desktop.
Configuration Objects vs. Many Parameters
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
// before - 5 args too many | |
function initializeNewUserWorflow( | |
email, password, location, | |
organization, referred) { | |
// initialize the new user | |
} | |
// after - using configuration object | |
const initializeUserConfiguration = { | |
email: 'email', | |
password: 'password', | |
location: 'location', | |
organization: 'kla', | |
referred: true, | |
}; | |
function initializeNewUserWorkflow(initializeUserConfiguration) { | |
// do the thang | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment