+ 3
Can't Count Length of Variable in Javascript
You can see at line 21, I tried to use length property to the "result" variable but it results undefined. Please help me with this https://code.sololearn.com/WFvlUxU294Kr/?ref=app
3 ответов
+ 6
There is also this method of converting it into string and then counts it's length.
result = 17778
alert(result + "").length;
Returns the length of result.
+ 7
You can turn the variable result in string first and then can count it's length.Like this.
result.toString().length.
There are many other ways also to turn it into string.
+ 2
Thanks for your help. It worked perfectly👌