pretty recursive function from John Resig
Download (right click, save as, rename as appropriate)
1 2 3 4 5
function yell(n) { return n == 0 ? 'hey' : yell(n - 1) + 'a'; } alert(yell(4));