New: Intelligent Flashcards spaced-repetition decks for every topic, built to make things actually stick.
Your API sends a count as the string "5", but your code says const n = data.count as number. What happens at runtime?
const n = data.count as number
The value is converted to the number 5, exactly as if you had called Number("5") on it
Number("5")
A TypeError is thrown when the assertion is evaluated
Nothing. The string stays put and the compiler simply believes you