MODULO Full Stack Web Development: The Ultimate Master SagaTHEORY

Write a reusable price calculation

Write an arrow function lineTotal that takes a unit price and quantity and returns their product. Run it for (25, 3), (25, 0) and (0, 3). Try a block body without a return statement.

Check your work

The three totals are 75, 0 and 0. A block body needs an explicit return. A concise expression body such as (price, quantity) => price * quantity returns the result directly.