Converting a string to a number is pretty easy in TypeScript. The unary ( + ) operator is the easiest way to convert a string into a number. We can also use the Number function to convert number-like strings into numbers. This will work with both integers and decimals.
Table of contents
Converting a String to a Number in TypeScriptSort: