The boolean data type can hold either true or false. Declaring and initializing this data type is quite easy and is illustrated as follows:
let isSaved: boolean = false;
Here, the isSaved variable is declared as boolean and is assigned with the value false. If the developer assigns a string value to the isSaved variable by mistake, the TypeScript will show an error and highlight the statement.