ES6 Sets and Maps

es6 sets and maps

ES6 includes two data structures which help programmers get work done without reinventing the wheel. These two data structures are those of Sets and Maps. A Set can be thought of as a collection of elements that are both unordered, and unique. That is the key to remember. The purpose of a Set is to guarantee the uniqueness of its items. A particular element is a member of the set if the set contains the element.…

9 New Array Functions in ES6

new array functions in es6

There are many new extensions to the array object in ES6. In this journey of learning the foo of ES6, we will set our targets on mastering the ways of new functions like Array.of(), Array.from(), Array.fill(), Array.find(), Array.findIndex(), Array.copyWithin(), Array.entries(), Array.keys(), and Array.values(). These new functions make it easier to fill up arrays, or find data within them. In addition to that it is now easier to work with specific keys and values in the array itself.…

ES6 Generators

es6 generators

Generators in ES6 are a special kind of function that return an iterator. They are quite a bit different than your standard run of the mill function in JavaScript however. Generators can pause themselves as they are running, and return multiple values as execution pauses and resumes. You use an iterator to call a generator multiple times. Let’s look at some examples to better understand how generators work.…

Iterators In ES6

iterators in es6

Iterators are a major new feature in ES6, and are used extensively already. Iterators are used for lazy evaluation, or in cases where describing an infinite sequence is needed. Soon we will be looking at Generators, and it helps to have a grasp of iterators before we do so. In fact, Iterators are kind of a prerequisite for Generators, Promises, Sets, and Maps. Let’s look at the basics of Iterators here, and get up to speed with them.…

ES6 Promises Tutorial

es6 promises

Modern programming languages have a jargon all to themselves. We are inundated with acronyms and foreign-sounding words every day. Today, we’ll be talking about Promises. If you make use of our good friend Webster, you’ll find something along the lines of this for the meaning of a promise: A declaration or assurance that one will do a particular thing or that a particular thing will happen.

ES6 Class Tutorial

es6 class tutorial

Object Oriented Programmers Rejoice! ES6 now has support for classes! This ES6 Tutorial will look at how JavaScript now has a class keyword as of ES6, and you can make use of it to program in a similar way as to how you might in C#, Java, or PHP. Classes in ES6 are definitely a step in the right direction to achieving true object-oriented programming, but truth be told, these are not classes in the purest sense of the word.…