Please enable JavaScript
How To Get the First Digit of a Number in JavaScript. A number is a primitive data type, which is not an object and does not have any attributes or methods. The first digit refers to the first number when we look at the number from left to right.