+ 1
How do i count variable in javascript
var G = 123456789; So how am i to count the variable G in javascript.
5 Respostas
+ 3
console.log( String(G).length );
+ 2
Thanks
+ 2
String(G.length)
+ 1
For numbers you need to implement logics for string you can use . length
+ 1
U use the function of string(g).length to get the desired result