Why do I get no error/warning when assigning an undefined to a string-typed constant in the following statement?
Why can I do
const s : string = undefined;
in non-strict mode, but can not do
const s: string = 5;
?
Is there a rule in Typescript specification that treats undefined differently than number when it comes to type checking?
(I understand I can turn the strict mode to enforce that, I'm curious about the mechanism that makes this possible in non-strict mode specifically).