0

Hi How can i do this? Ty

I wanna turn "y" a numeric var to get (y+5) without getting concatenation. Ty in advance. https://code.sololearn.com/WG21SImVNIes/?ref=app

9th Apr 2018, 11:39 PM
Juanma De la Flor
Juanma De la Flor - avatar
9 Réponses
+ 4
It should. You sure you write parseint with capital i? You can try Number.parseInt() but I don’t think it makes any different.
10th Apr 2018, 10:45 AM
Toni Isotalo
Toni Isotalo - avatar
+ 3
var y = prompt("Introduce un numero"); y = parseInt(y);
9th Apr 2018, 11:53 PM
Toni Isotalo
Toni Isotalo - avatar
+ 2
parseInt(y);
9th Apr 2018, 11:41 PM
Toni Isotalo
Toni Isotalo - avatar
+ 1
Thanks
9th Apr 2018, 11:43 PM
Juanma De la Flor
Juanma De la Flor - avatar
+ 1
Please could u tell me how it woulf fix into my script, just to get it as an example. Ty mate
9th Apr 2018, 11:51 PM
Juanma De la Flor
Juanma De la Flor - avatar
+ 1
Ty mate, very appreciated.
9th Apr 2018, 11:53 PM
Juanma De la Flor
Juanma De la Flor - avatar
+ 1
var y = prompt("Introduce un numero"); y = parselnt(y); var x = y + 5; alert(x); it says "parselnt" is not defined line 5 cant make it work
10th Apr 2018, 10:38 AM
Juanma De la Flor
Juanma De la Flor - avatar
+ 1
Gonna check it, ty Toni your help is very appreciated.
10th Apr 2018, 10:47 AM
Juanma De la Flor
Juanma De la Flor - avatar
+ 1
LOL sorry, i was writing parseLnt, tought it was an L, it Works perfectly now
10th Apr 2018, 11:11 AM
Juanma De la Flor
Juanma De la Flor - avatar