What is the output?
const arr = [1, 2, 3] as const; console.log(arr.length);
- 3
- 0
- undefined
- Error
as const only narrows the type; the runtime value is an ordinary array.const arr = [1, 2, 3] as const; console.log(arr.length);
as const only narrows the type; the runtime value is an ordinary array.