How To Turn "text" Number into An Integer?

I have a special case in which I cannot pass variables containing integers and must pass text instead. Is there a way to convert text numbers to integers.

var num = “1”;

Is there a way to turn the snippet above into an integer?

Again, I can simply use “var num = 1”. The special case that I have prevents this.

Thank you so much in advance.

https://www.w3schools.com/JSREF/jsref_parseint.asp

Excellent!

Thank you.

Also using Number(“100”) will convert a strong to a number.