How to generate logic through the ternary operator?
-
Help solve a logical problem, there is a product in the basket, for every 3rd unit there is a 50% discount, that is, 1 product - 10, 3 products - 25, and so onJavaScript Connor Porter, Sep 8, 2020
-
price% 3 === 0? price * 10 - (price / 3) * 0.5 * 10: priceAnonymous
1 Answers
Your Answer
To place the code, please use CodePen or similar tool. Thanks you!