JSFiddle - React, Tailwind, and code Playground

by Mahendra Maurya

JavaScript

let x = 1234;
function countNumber(x){
var coun = 0;
while(x>0){
x = x/10;
coun += 1;
alert(coun);
}
return coun;
                 };
console.log(countNumber(x));