var 12345 var right 10 var left Math floor 10 console log right left w

1
2
3
4
5
6
7
8
9
var x = 12345;
var right = x % 10;
var left = Math.floor(x / 10);
console.log (right, left);
while (left > 0){
right = left%10;
left = Math.floor(left/10);
console.log (right, left);
}