How can I check the value is of type in typescript?

后端 未结 0 1942
被撕碎了的回忆
被撕碎了的回忆 2021-02-04 07:11

Having something like this

type Size = \'big\' | \'small\';

How can I test that \'test\' if a value is Size

const test = \'equal\'         


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