Collections in TypeScript

TypeScript also has the ability to work with collections of DOM elements. Let's look at them using the following example. Let's say we have several div tags:

html<div></div>
<div></div>
<div></div>

Let's write a collection of these DOM elements into a variable:

typescriptlet lst: NodeList = document.querySelectorAll('div');
Задание 1

Make a variable that will contain the Map collection.

Задание 2

Make a variable that will contain the Set collection.

Задание 3

Make a variable that will contain the NodeList collection.

Задание 4

Make a variable that will contain the HTMLCollection collection.