typeUser={name:string}constuser={name:'john'}Object.defineProperty(user,"name",{value:undefined});alert(user.name.length);// Cannot read property 'length' of undefined (in JavaScript after transpilation)
This compiles just fine in TypeScript and even gives an error in the playground when run.
This compiles just fine in TypeScript and even gives an error in the playground when run.
Sure, but come on, that's just deliberately trying to deceive TypeScript at this point ^^