TypeScript · Junior · Question 62 of 75

How do you call a generic function with an explicit type argument?

const value = parse<User>(json);

Explanation

Usually TypeScript infers type arguments from the values. Explicit arguments help when there is nothing to infer from.

Further reading

Problem with a question

TypeScript · Junior · question 62

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