Quiz · Async code and outside data · lesson 8 of 10Quiz — why types don't check a responseWhy can't TypeScript check the data a server really sends back to a fetch call?[A]It cannot check it because response.json() returns any. Declaring the result as unknown instead makes tsc check the data against User when it arrives, so a reply with a missing field is caught at the line where it is received.[B]TypeScript does check the reply, but only after the promise settles: await compares the data with User and throws when they differ. Without await the reply passes unchecked, which is why a forgotten await lets bad data through to the rest of the program.[C]An annotation like User makes tsc add a check to the JavaScript, which throws a TypeError as soon as a declared field is missing. The gap appears only with any, which takes the reply out of that generated check, so the fix is to avoid any in the code that reads the reply.[D]Types are erased at compile time, so nothing of User is left at run time. response.json() returns Promise<any>, and writing User on the result states a shape without looking at the reply. The data is really unknown until a run-time check confirms it.← BackData from outsideNext →Assertions: as and !