Experimenting with simple algorithms brought me to this code. I'm curious if anyone has a more concise version in JavaScript for displaying a pyramid:
const max= 30;
let row = 1;
for (let i = 1; i < max; i += 2) {
console.log(' '.repeat(max / 2 - row) + '*'.repeat(i))
row++;
}