Hello Friends 👋,
Welcome To Infinitbility! ❤️
I will recommend the unary
+ operator because is the fastest way to convert a string to a number.
1let x: string = "32";2let y: number = +x; // 32
1let x: string = "32";2let y: number = parseInt(x); // 32
1let x: string = "32.43";2let y: number = parseFloat(x); // 32.43
Join our email list and get notified about new content
No worries, I respect your privacy and I will never abuse your email.
Every week, on Tuesday, you will receive a list of free tutorials I made during the week (I write one every day) and news on other training products I create.