Last active
January 3, 2020 00:18
-
-
Save jfrites/a67810c106bd39a68aba03edddb9c38f to your computer and use it in GitHub Desktop.
Switch Statement JS Example
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
const taxCalulator = (amount, state) => { | |
switch (state) { | |
case "NY": | |
return amount * 1.04; | |
case "NJ": | |
return amount * 1.0625; | |
default: | |
return amount; | |
} | |
}; | |
console.log(taxCalulator(100, "NJ")); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment