logoalt Hacker News

Narishmatoday at 5:51 PM1 replyview on HN

Didn't you just shift the branch to the calculateDiscount() function?


Replies

1718627440today at 8:38 PM

Not necessarily.

   return 1 - user.isPremiumMember * 0.1;
would also cut it.