Slacker News Slacker News logo featuring a lazy sloth with a folded newspaper hat
  • top
  • new
  • show
  • ask
  • jobs
Library
← Back to context

Comment by Narishma

19 hours ago

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

1 comment

Narishma

Reply

1718627440  16 hours ago

Not necessarily.

   return 1 - user.isPremiumMember * 0.1;

would also cut it.

Slacker News

Product

  • API Reference
  • Hacker News RSS
  • Source on GitHub

Community

  • Support Ukraine
  • Equal Justice Initiative
  • GiveWell Charities