QUESTION: Как работать с массивами?
Working with arrays in JavaScript is an everyday task for any developer, as arrays serve as the primary tool for storing ordered collections of data. There are many ways to create arrays and manage their contents depending on the current project tasks.
You can create an array using the square bracket literal [], the new Array() constructor, or the static Array.from() method, which converts iterable objects or array-like objects into a full-fledged array. Various built-in methods are used to modify the structure and contents of arrays.
The following approaches are used to modify elements:
To combine multiple arrays, you can use the concat method or the modern spread operator, denoted by three dots, which elegantly unpacks elements. To find elements in an array, the includes method is used (returning a boolean value depending on whether the element exists) and indexOf (returning the index of the first occurrence of the searched value).