Programming becomes really interesting when it comes to working sets (collections) of elements. Here are just a few examples where they appear:
- Paginated data output on the website
- Calculation of the order total based on each item’s price
- Display of a list of friends, messages, movies and the like
- Processing a set of DOM-nodes (HTML, frontend development)
Any list we encounter in a real or virtual world is a collection of elements from a programmer’s point of view. JavaScript uses an array to store it - a data structure that allows you to work with a set as a single entity.
// declaration of an array of friends
const friends = ['john', 'nancy', 'eugen'];
Unlike primitive data types, arrays in JavaScript may change. And both in terms of the content and size of the array itself. It greatly influences how we handle them, adding more opportunities but also more responsibility. By using arrays, the same problem can be solved in many different ways. Only some of them will be good, while the rest will be inefficient and difficult to debug and analyze.
That’s why we devote a whole and rather large course to arrays, not just a few lessons. This course covers many cases where arrays are usually used. The knowledge gained in this course will become the foundation for all further learning path. The main subjects of this course are:
- Manipulations with arrays
- Processing arrays with loops
- Working with nested arrays using nested loops
- Sorting arrays
- Working with strings via arrays
In addition to arrays, we will touch on the topic of algorithms and data structures. You will be introduced to the concept of algorithmic complexity, learn how to implement some basic algorithms, which are often asked in job interviews. Knowledge of these topics, at least at a basic level, is critical for writing an effective code.
For full access to the course you need a professional subscription.
A professional subscription will give you full access to all Hexlet courses, projects and lifetime access to the theory of lessons learned. You can cancel your subscription at any time.