-
-
Save delineas/71a0500559e4ba7a39775b2dfa4f8f48 to your computer and use it in GitHub Desktop.
Reto Refactorización WRP 36
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
class Product { | |
amount() { | |
let product_price = this.quantity * this.productPrice; | |
let discountRate = 1; | |
if(product_price > 1500) { | |
discountRate = 0.7; | |
} | |
else { | |
discountRate = 0.95; | |
} | |
return product_price * discountRate; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment