The annotation or the value
Use the caller to decide whether a declared type or a value is wrong.
your task
Fix two lines in summary.ts. Change one type annotation and one value. Use “paid” and “unpaid” for the payment labels. All files must compile and the case must print its expected line.
The report prints true where the payment label belongs. In caller.ts, the seat count is used in arithmetic and the payment label is used as text. The booking data in data.ts is fixed.
Run code does two things. First the compiler checks the types and lists each error with its line. Then your code runs once for each case. A type error does not stop the run. The exercise is solved when there are no type errors and every case passes.
Starter code
or press Ctrl EnterNot run yet
type check
Not run yetsummary.ts
Expected result: no type errors.
cases
Not run yetA paid booking with four seats
Expected output
1
Atlas, next seat 5, paidSee the input and the code for this case
console.log(room + ", next seat " + (seats + 1) + ", " + paidLabel);