Liliana797979

triangle of numbers1 - fundamentals

May 21st, 2021
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function triangle(num) {
  2.    
  3.     for (let i = 1; i <= num; i++) {
  4.         let line = i + ` `;
  5.         console.log(line.repeat(i));
  6.     }
  7. }
Advertisement
Add Comment
Please, Sign In to add comment