01 / 05
A value itself can be a type
What you can write as a type is not only a kind like string. You can write the value itself, like "red", as a type.
Write that and the only thing that can go into the variable is "red". One on its own is not much use, but the next slide puts it to work.
const color: "red" = "red";console.log(color);Result
red