-
-
Save CheezItMan/9803eb75dcb2142dad5d7a59792b80aa to your computer and use it in GitHub Desktop.
Finished JS Translation From Ruby
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 coffeePrice = function coffeePrice(isIced, size, flavorArray){ | |
let price = 2.50; | |
if(size == 0){ | |
; | |
} else if (size == 1) { | |
price += 1; | |
} else { | |
price *= 2; | |
} | |
if (isIced){ | |
price += 0.75; | |
} | |
for(let i = 0; i < flavorArray.length; i++){ | |
console.log(`pumping ${flavorArray[i]}`); | |
price += 0.50; | |
} | |
return price | |
} | |
console.log(coffeePrice(true,3,['vanilla','lemon'])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment