var 6116 var x2 10 var x3 Math floor 1000 var x4 Math floor 100 10 var

1
2
3
4
5
6
var x = 6116;
var x2 = x%10;
var x3 = Math.floor (x/1000);
var x4 = (Math.floor (x/100)) %10;
var x5 = Math.floor((x%100)/10);
console.log (x, x2, x3, x4, x5);