Skip to main content
FUNCTIONAL-PROGRAMMING5 MIN READ

Refactor the pricing rule without hiding state

Choose a refactor that isolates pure pricing logic from effectful checkout code.

You need to fix a checkout pricing helper that reads hidden context and mutates the cart. The team wants a refactor that will make the next pricing bug easy to reproduce.

Read the full lesson

Sign up free — one personalized lesson every day, matched to your role and goals.

Already have an account? Sign in

← Back to library
Contact us