布林

布林值表示 TypeScript 中最基本的資料型別,用於指定 true / false 值。

// set with initial value (either true or false)
let isTrue: boolean = true;        

// defaults to 'undefined', when not explicitely set
let unsetBool: boolean;             

// can also be set to 'null' as well
let nullableBool: boolean = null;