Codington
0 of 6 problems solved • 0%
Use in a course

Exercise prompt

Arrow Price Summary

A shop needs a subtotal and a discounted total from the supplied values.

Your task

  1. Declare calculateSubtotal(price, quantity) as a concise arrow function.
  2. Declare applyDiscount(subtotal, discount) with braces and an explicit return.
  3. Use them to calculate subtotal and finalTotal from the supplied values.

Display exactly:

Subtotal: 60 Final total: 50