JavaScript Taskbook Level 8.1

Задание 1

Given an array:

javascript[
  [1, 2, 3],
  [1, 2],
  [1, 2, 3, 4, 5],
  [1],
  [1, 2, 3, 4],
]

Sort the array elements in ascending order of the number of elements in the subarray.

Задание 2

Given an array:

javascript[
  [2, 4, 5],
  [1, 2, 3],
  [0, 1, 1],
  [5, 7, 1],
]

Sort the array elements in ascending order of the sum of the subarray elements.

Задание 3

Display the following pyramid on the screen:

x
xx
xxx
xxxx
xxxxx