Yeah... reading and calculating with single digits... I should buy a cape.
And I wouldn't use JS, if I had a choice. But if I would, it would surely not look like the stinking mess you posted. Perhaps you should first try to write proper working code before you go all code golf on it.
For your information: 10*10^0+10*10^1+10*10^2+.. is not ...101010
Also: t.substr(0,1)+t.substr(t.length-1,1) is an interesting way to split a string; I'm sure this will work for all cases.
Oh, one more thing: code golfs sucks balls!