how to convert a string to a number in typescript code example
Example 1: string to int typescript
Number('123') //123
Number('xxx') //NaN
Example 2: typescript cast string to number
var x = "32";
var y = +x; // y: number
Number('123') //123
Number('xxx') //NaN
var x = "32";
var y = +x; // y: number