From the course: TypeScript Essential Training

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

Challenge: The right type

Challenge: The right type

(upbeat music) - Now, I've shown you a lot of content since our last challenge, but I've waited before I showed you this next challenge because it will take almost everything I've shown you since then in order to complete this one. And here's your challenge, replace this any type with the right type for this scenario, that's it. Now what's the right type? Well, it's this object right here. An object that allows for properties that match the properties of the objects in the array above it. And each of these properties on this query object, should be a function that accepts the value of that property and returns true if the value matches the function, and false if it does not. You'll know you've got it right when you can hover over this and see the type string instead of this type string warning. Seem familiar? Well, yeah, it's basically the same example code I've been showing you for the past six videos, but just…

Contents