var a = 2345; alert( ~~(a / 10) % 10 );
for (var temp = 2345, arr = []; temp;) { arr.unshift(temp % 10); temp = (temp - temp % 10) / 10 }; alert(arr);
for(var i=1,mass=[],number=123456789,temp=0;true;i*=10) { temp=parseInt((number/i)%10); if(temp==0) { break; } mass.unshift(temp); } alert(mass);
var number = 54321; alert(/(.)/.constructor(("India is the greatest country!").replace(/(.)/g,'(.)?'),'g').exec(number)[2]) /* 4 */