Skip to content

Instantly share code, notes, and snippets.

@delineas

delineas/product.js Secret

Last active Sep 13, 2019
Embed
What would you like to do?
Reto Refactorización WRP 36
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
You can’t perform that action at this time.