点击查看【bilibili】

void

函数没有返回值

  1. function say_hello(name:string):void{
  2. console.log(`hello ${name}`)
  3. }
  4. say_hello('xiaoming');

null undefined

let u:undefined = undefined;
let n:null = null;


let n1:string | null | undefined;
n1 = undefined