Is there a way of providing polymorphic type discrimination similar to Rust's enums?

前端 未结 0 1287
长发绾君心
长发绾君心 2020-12-13 03:58

I\'ve recently returned to JS/TS after coding a lot in Rust and this is a feature I really miss.

So suppose that I have a value which may be an instance of Cat<

相关标签:
回答
  • 消灭零回复
提交回复
热议问题