Find Number of Digits in Number

Count the number of digits in a long integer entered by a user.
function countDigit(n) {    let count = 0;    while (n != 0)
}
function countDigit(n) {    let count = 0;    while (n != 0)
{
n = Math.floor(n / 10);
}
}
function countDigit(n) {    let count = 0;    while (n != 0)     {        n = Math.floor(n / 10);        ++count;     } return count;}

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store