Text to Integers in Applab

1.6k Views Asked by At

In Code.org's Applab I'm trying to convert the text from a textinput box or a dropdown into an integer so that i can do mathematical functions with it. However, parseInt doesn't seem to work. How do I convert the text into an integer?

1

There are 1 best solutions below

0
On

You can use Number(). For example, console.log(Number('2') + 2) outputs 4.