Created
September 14, 2017 12:38
-
-
Save gokusenz/e24079092b149e7e91136a2cb5852e2e to your computer and use it in GitHub Desktop.
Javascript Example Test
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
| const lookupTaxRate = (region) => { | |
| if(region == '') { | |
| throw 'Region can\'t be blank!' | |
| } | |
| var taxRate = 0.5 | |
| if(region == 'Chiang Mai') { | |
| taxRate = 0.4 | |
| } | |
| if(region == 'Bangkok') { | |
| taxRate = 0.3 | |
| } | |
| if(region == 'Phuket') { | |
| taxRate = 0.2 | |
| } | |
| if(taxRate <= 0.3) { | |
| taxRate = 0 | |
| } | |
| return taxRate | |
| } | |
| console.log(lookupTaxRate("Bangkok")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment