+ 6

Is parseInt and parseFloat now optional in JavaScript?

I saw parseInt and parseFloat online they are used to convert strings to integer and float point number respectively but i dont know how to use it. Is these two methods now optional? All the beginner codes that i've written worked very well without converting the user's input to either integer or float.

26th Nov 2019, 12:15 PM
Surveyor
Surveyor - avatar
1 Odpowiedź
0
// See my code https://code.sololearn.com/W249793Ymx5M/#html // In the example above I present the use of ParseInt, ParseFloat and a new way. // The use of the same is for if you receive a text and do not want join this, them but add or perform any other operation since the plus (+) also represents concatenation.
28th Nov 2019, 1:30 PM
Jônatas Araripe
Jônatas Araripe - avatar