Advertisement
Spocoman

07. Christmas Tree

Jan 3rd, 2022 (edited)
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function christmasTree(input) {
  2.     let n = Number(input[0]);
  3.  
  4.     for (let i = 0; i <= n; i++) {
  5.         console.log(`${' '.repeat(n - i)}${'*'.repeat(i)} | ${'*'.repeat(i)}${' '.repeat(n - i)}`);
  6.     }
  7. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement