Practice on creating ul lists in JavaScript

Задание 1

Given an ul:

html<ul id="elem"></ul>

Given an array. Insert the elements of this array at the end of ul so that each element is in its own li.

Задание 2

Modify the previous task so that when you click on any of the inserted elements, the text of this element is displayed on the screen.

Задание 3

Modify the previous task so that clicking on a li adds '!' to its end.

Задание 4

Modify the previous task so that pressing the li again doesn't add a second '!'.