The seat count runs but fails the type check
Code can print the right number while TypeScript reports an error.
your task
Fix the calculation in seatsLeft. Keep both parameter types. The type check and all three existing outputs must pass.
Run the starter. All three seat counts are correct, but TypeScript reports the subtraction in seats.ts. The caller gets the number of taken seats as text from the page.
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 yetseats.ts
Expected result: no type errors.
cases
Not run yet3 of 12 seats taken
Expected output
1
9See the input and the code for this case
console.log(seatsLeft(12, "3"));
Not run yet10 of 12 seats taken
Expected output
1
2See the input and the code for this case
console.log(seatsLeft(12, "10"));
Not run yetEvery seat taken
Expected output
1
0See the input and the code for this case
console.log(seatsLeft(8, "8"));