The Utils Folder 10 exercises
solution

Annotate a Return Type with a Type Predicate

The solution is to add a return type annotation to hasDataAndId that has a type predicate. We need to specify that the value parameter is an object with a data property, which itself has an id property of type string. This annotation guides TypeScript to narrow down the type of value cor

Loading solution

Transcript

no