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:
<div></div>
<div></div>
<div></div>
Let's write a collection of these DOM elements into a variable:
let lst: NodeList = document.querySelectorAll('div');
Make a variable that will contain the Map collection.
Make a variable that will contain the Set collection.
Make a variable that will contain the NodeList collection.
Make a variable that will contain the HTMLCollection collection.