In TypeScript, I can catch error from the following script.
let num: number = 1;
num = 'abc';
But the following script can be executed without error:
let num: number = 1;
let s = '{"a":"abc"}';
let j = JSON.parse(s);
num = j.a; // assigning a string "abc"
So what's the correct way to catch error from the second script.