DEV Community

Discussion on: Template String Types as Discriminants in Typescript 4.5

scooperdev profile image
Stephen Cooper

In the final example I guess the following would also work as a use case that gets correctly discriminated. This is such a powerful feature!

if(response.status === "301") {
Enter fullscreen mode Exit fullscreen mode
mainawycliffe profile image
Maina Wycliffe Author

Yeah, that would work as well