I would like to know if 2 digits can be used in JavaScript if the number is less than 10?
eg
10,9,8,7,6 and so on 10,09,08,07,06 as "data type data"
yes, it is possible to display digits in 2 digits when the numbers are less than 10 as a "string data type".
if(number < 10) {
console.log(number)
number = "0" + number;
console.log(number)
}
but I want to use it as a data data type, so I can use
if(number == 01) {
}
Is it possible?
source
share