You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

exer_6.js 320B

1234567891011121314151617
  1. function makeLine(size) {
  2. let line = '';
  3. for (let i = 0; i < size; i++) {
  4. line += '#';
  5. }
  6. return null;
  7. }
  8. function makeDownwardStairs(size) {
  9. let downwardStairs = '';
  10. for (let i = 0; i <= size; i++) {
  11. downwardStairs += makeLine(i) + '\n';
  12. }
  13. return downwardStairs.trim();
  14. }
  15. console.log(makeDownwardStairs(5))