How to generate logic through the ternary operator?

  • 0
    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 on
    JavaScript Connor Porter, Sep 8, 2020

  • 1 Answers
  • 0
    price% 3 === 0? price * 10 - (price / 3) * 0.5 * 10: price
    Anonymous

Your Answer
To place the code, please use CodePen or similar tool. Thanks you!