Last active
April 5, 2023 14:40
-
-
Save DevGW/c2e2620006d5808a5a97a799a128a428 to your computer and use it in GitHub Desktop.
Javascript :: using return #js
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
function taxCalculator(price, state) { | |
if (state === 'NY') { | |
return price + price*0.04; | |
} else if (state === 'NJ') { | |
return price + price*0.06625; | |
} | |
} | |
function greeting(name) { | |
if (name !== undefined) { | |
return `Hello ${name}!`; | |
} else { | |
return 'Hello!'; | |
} | |
} | |
function doYouPlayTheTheremin(name) { | |
if (name[0] === 's' || name[0] === 'S') { | |
return true; | |
} else { | |
return false; | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment