Last active
June 26, 2019 17:29
-
-
Save danielkellyio/03202a490627c8c6851e61017dd407de to your computer and use it in GitHub Desktop.
How not to set a single variable based on multiple conditions
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
let friendly_timezone; | |
if( tz_timezone === 'America/New_York' ){ | |
friendly_timezone = 'Eastern'; | |
}else if( tz_timezone === 'America/Chicago'){ | |
friendly_timezone = 'Central'; | |
}else if( tz_timezone === 'America/Denver'){ | |
friendly_timezone = 'Mountain'; | |
}else if( tz_timezone === 'America/Los_Angeles'){ | |
friendly_timezone = 'Pacific'; | |
}else{ | |
friendly_timezone = 'No Timezone Specified'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment