const XXX = length => Array
.from({ length }, (n, i) => Array
.from({ length: i + 1 }, (n, i) => i + 1)
.join(','))
.join('\n');
console.log(XXX(5));
const XXX = length => Array
.from({ length }, function() {
this.push(-~this.length);
return this.join`,`;
}, [])
.join`\n`;
const XXX = length => Array
.from({ length }, (n, i) => Array
.from(Array(++i).keys())
.reduce((acc, n) => acc + (acc && ',') + ++n, ''))
.reduce((acc, n) => acc + (acc && '\n') + n, '');