In TypeScript, is there a difference between optional parameters and parameters than can be undefined?

后端 未结 0 439
谎友^
谎友^ 2021-02-01 09:00

I was wondering if there was a difference between the these two bits of code:

function sayHello(name?: string) {
  if (name) { return \'Hello \' + name; }
  retur         


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