Typechecking in vanilla JS – why use typeof for string but typeof .matches for booleans?

后端 未结 0 405
既然无缘
既然无缘 2021-01-26 10:20

I\'m checking some variables from localStorage before continuing my script. First this:

const hasStorageValue = typeof storageValue === \'string\'
<
相关标签:
回答
  • 消灭零回复
提交回复
热议问题