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

 

 

 

Saved you some valuable time?

Received 100 so far from 4 kind contributors.