Javascript: length broja

Problem:

var x = 123;

Zanima nas length varijable x.

Rješenje:

var x = 123;
x.toString().length;

Comments are closed.