TypeScript · Junior · Question 67 of 75
What type does await (await fetch(url)).json() have?
- ✓Correct answer:
any- you should annotate or validate the result - 2The type of the API response automatically
- 3
unknown
Explanation
Response.json() returns Promise<any>. Assign it to a typed variable or, better, parse it with a schema to catch API changes.