vikkktor

Basic Syntax_07.triangleOfNumbers

Sep 24th, 2021 (edited)
830
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function solve(n) {
  2.     for (let i = 1; i <= n; i++) {
  3.         /* !!! */
  4.         let output = "";
  5.  
  6.         for (let j = 1; j <= i; j++) {
  7.             output += (`${i} `);
  8.         }
  9.         console.log(output)
  10.     }
  11. }
  12.  
  13. solve(5)
RAW Paste Data