JavaScript Taskbook Level 8.4

Задание 1

Given a button and a block with text. The text does not fit into the block in height and is hidden. Click on the button to expand the block to its full height.

Задание 2

Given a string of text, get the percentage of each character in the text as an object where the keys are the characters and the values ​​are their percentages.

Задание 3

Given a list of ul and an input. As you type text into the input, leave visible only those li whose text begins with the text entered into the input.

Задание 4

Display the following pyramid on the screen:

1
22
333
4444
55555
666666
7777777
88888888
999999999
Задание 5

Given a list of cities and their countries, stored in the following structure:

javascriptlet data = [
  {
    country: 'country1',
    city:    'city11',
  },
  {
    country: 'country2',
    city:    'city21',
  },
  {
    country: 'country3',
    city:    'city31',
  },
  {
    country: 'country1',
    city:    'city12',
  },
  {
    country: 'country1',
    city:    'city13',
  },
  {
    country: 'country2',
    city:    'city22',
  },
  {
    country: 'country3',
    city:    'city31',
  },
]

Write code that will remake the data structure into this:

javascript{
  'country1': [
    'city11', 'city12', 'city13',
  ],
  'country2': [
    'city21', 'city22'
  ],
  'country3': [
    'city31', 'city32'
  ],
}