function printDigit(n) { document.write(n); } function printOut(n) { if (n >= 10) printOut(parseInt(n / 10)); printDigit(n % 10); } printOut(10086);