How to cast a string to a Number in Typescript

I had this use case where I got data from an API that gave me an id in a string format. 

Solution

This was the solution:

Number('4'); // 4