JavaScript Taskbook Level 8.6

Задание 1

Given a paragraph with text and a button. By clicking on the button, paint each symbol a random color so that adjacent symbols have different colors.

Задание 2

Given a paragraph with words and input. A word is entered into the input. By clicking on the button, find this word in the paragraph and paint it red.

Задание 3

Given a menu with links, color the link red if its address matches the URL from the browser address bar.

Задание 4

Display the following pyramid on the screen:

xxxxx
xxxx
xxx
xx
x
Задание 5

Given a list of events for specific dates, stored in the following structure:

javascriptlet events = [
  {
    date:  '2019-12-29'
    event: 'name1'
  },
  {
    date:  '2019-12-31'
    event: 'name2'
  },
  {
    date:  '2019-12-29'
    event: 'name3'
  },
  {
    date:  '2019-12-30'
    event: 'name4'
  },
  {
    date:  '2019-12-29'
    event: 'name5'
  },
  {
    date:  '2019-12-31'
    event: 'name6'
  },
  {
    date:  '2019-12-29'
    event: 'name7'
  },
  {
    date:  '2019-12-30'
    event: 'name8'
  },
  {
    date:  '2019-12-30'
    event: 'name9'
  },
]

Write code that will remake the data structure into this:

javascript{
  '2019-12-29': ['name1', 'name3', 'name5', 'name7'],
  '2019-12-30': ['name4', 'name8', 'name9'],
  '2019-12-31': ['name2', 'name6'],
}