14.
Will TypeScript detect a problem with the following code? If so, what's the problem?
let x: number = "hello";
The code has a syntax error.
TypeScript will not detect a problem with this code.
No, there is no problem with the code.
Yes: Type 'string' is not assignable to type 'number'
Correct: D
Yes, TypeScript will detect a problem with this code. The code has a type mismatch error, where the variable x is declared as a number, but assigned the value hello which is a string. TypeScript's static type checking will flag this as an error and will generate: Type 'string' is not assignable to type 'number'.