function triangleNumber(num) { if(num>15) return; var str = ''; for(var i = num; i >= 1 ; i--) str += i; console.log(str); triangleNumber(num-1) } triangleNumber(1);