01 / 05
Arrays can be readonly too
Remember putting readonly on an object property to declare "this does not change later"? You can do the same to an array itself.
You write it by putting readonly in front of the array type. readonly string[] means "a read-only array of strings".
const colours: readonly string[] = [ "red", "blue",];console.log(colours.length);Result
2