from_to = function (from, to, f) { if (from > to) return; f(from); from_to(from+1, to, f); } from_to (1, 3, print);
Output