+ 4

Help for multiple text * var.

I needed to multiply a number of rows based on a var. See line 74-76 of the code. Does anyone know why output is coming out NaN? PS: What means NaN? https://code.sololearn.com/We0u0OWKEs9T/?ref=app

29th Jan 2018, 6:37 PM
Vinicius Rocha Perrud
Vinicius Rocha Perrud - avatar
2 Respostas
+ 2
NaN stands for Not a Number, meaning that the variable you are entering is not a number (it's quite self explanatory). I think the problem is that you're trying to test if a string equals an int, which does not bode well with JavaScript. Try changing 1 and 2 to "1" and "2", as testing to see if they are equal to a string may work. Hope this helped! d:
29th Jan 2018, 7:07 PM
Faisal
Faisal - avatar
+ 1
NAN means Not A Number
29th Jan 2018, 7:06 PM
Abdurrahman Abulgasim
Abdurrahman Abulgasim - avatar