dabidabidesh

Работи си!

Sep 16th, 2020
324
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function solve(number) {
  2.   if (typeof number === 'number') {
  3.     for (let i = 0; i < number; i++) {
  4.       let array = [];
  5.       for (let i = 0; i < number; i++) {
  6.         array[i] = '*';
  7.       }
  8.  
  9.       let result = array.join(' ');
  10.       console.log(result);
  11.     }
  12.   } else {
  13.     for (let i = 0; i < 5; i++) {
  14.       let array = [];
  15.       for (let i = 0; i < 5; i++) {
  16.         array[i] = '*';
  17.       }
  18.  
  19.       let result = array.join(' ');
  20.       console.log(result);
  21.     }
  22.   }
  23. }
RAW Paste Data