DEV Community

Discussion on: Daily Challenge #52 - Building a Pyramid

Collapse
 
delixx profile image
DeLiXx
function pyramid(i) {
    for( k = 1; i != 0; k++) {
        console.log(" ".repeat(--i) + "*".repeat(k*2-1));
    }
}