We'll cover more ES2015 features. These are more obscure, occasionally more difficult to understand, and have more limited use cases, but they make certain tasks easier and our code more elegant.
The following lessons include ES2015 constructs that aren’t used very often in writing code. Learning these concepts will unlock more elegant ways of accomplishing certain tasks.
New Data Structures
These data structures show their value when dealing with data that makes use of their strengths. Sets are excellent at filtering data. Maps are excellent when object keys need to be dynamic.
These data structures aren’t used very commonly in professional software, but knowing them will improve your ability to think critically and attack a problem from different angles. They’re especially impressive when used in coding interview problems.
New Data Type
We’ll cover Symbols as well. These are a brand new data type with a singular purpose and their behavior is quite odd.
Symbols are also needed to understand the implementation of iterators, which will allow us to define custom behavior in loops. We’ll be able to override the default behavior of loops and extend their functionality.
New Type of Function
Generators are last and allow us to create iterators easily. We can essentially return from a function multiple times and even pass values into the function. They’re very powerful and provide a new interface to solve complex problems.
— — —
Again, none of these items are needed to write functional, powerful code. However, the concepts embedded in these constructs help us understand problem-solving in new ways. We can come up with new solutions to problems and solve them more elegantly with these tools at our disposal.
I’ll see you in the next lesson.