Check out example codes for "typescript cast string to number". It will help you in understanding the concepts better.

Code Example 1

var x = "32";
var y: number = +x;//the "+" converts string to number

Code Example 2

var x = "32";
var y = +x; // y: number

Learn ReactJs, React Native from akashmittal.com