TypeScript · Junior · Question 67 of 75

What type does await (await fetch(url)).json() have?

Explanation

Response.json() returns Promise<any>. Assign it to a typed variable or, better, parse it with a schema to catch API changes.

Further reading

Problem with a question

TypeScript · Junior · question 67

Test yourself

Take the TypeScript · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz