![Learning Ionic(Second Edition)](https://wfqqreader-1252317822.image.myqcloud.com/cover/231/36701231/b_36701231.jpg)
上QQ阅读APP看书,第一时间看更新
Variable typing
In vanilla JavaScript, we would do something like this:
x = 20;
// after a few meaningful minutes
x = 'nah! It's not a number any more';
But in TypeScript, we cannot do as shown in the preceding code snippet, the TypeScript compiler would complain as we are modifying the variable type at runtime.