let num = 1001; console.log(string(num).length - 1);