Type Guard to make sure a variable is an object in TypeScript

后端 未结 0 1931
一个人的身影
一个人的身影 2020-11-22 14:01

Normally, to determine variable type in TypeScript, I can do something like this:

if (typeof payload === \'string\') {
    console.log(payload) // const paylo         


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