The booking total prints as a promise
Follow a promised value through a price helper and its caller.
your task
Fix the calculation and its caller. Keep bookingTotal async. Each case must print “total: ” followed by the numeric price for all hours.
The starter prints total: [object Promise] for both bookings. readRate() supplies the hourly rate later. Follow that value through bookingTotal and the line that prints the total.
Run code runs your code once for each case. It compares what your code prints with the expected output.
Starter code
or press Ctrl EnterNot run yet
cases
Not run yet3 hours at 40
Expected output
1
total: 120See the input and the code for this case
const hours = 3;
function readRate() { return Promise.resolve(40); }Not run yet2 hours at 12.5
Expected output
1
total: 25See the input and the code for this case
const hours = 2;
function readRate() { return Promise.resolve(12.5); }