When fat arrow functions were first added to JavaScript, I rejoiced. For a language where you often end up writing small functions is place as an argument passed to something, having a concise way to define an anonymous function was really handy. A great example would be the following vs
Category: ES6
JavaScript: ES6 modules made simple
Before ES6 there was no native system in JavaScript for importing modules. There were tools like commonjs, but nothing built into the language spec. Every other major language seems to have a way to do this, so the fact that JavaScript lacked this did lend credence to the people who
Object Oriented Programming In JavaScript – Part 3: ES6 Classes
ES6 introduced a whole host of new features into JavaScript. One of these was the class syntax. It gives us a way of defining ‘classes’ in JavaScript which is similar to more traditional Object Orientated languages such as Java. The reason I put ‘classes’ in inverted commas is because despite
Mastering Asynchronous JavaScript: Part 3 – Generators
Last time I showed you how promises can make asynchronous programming in JavaScript easier than using callbacks. Now I’ll show you some cutting edge JavaScript features that will make asynchronous programming a breeze. Introduction To Generators One of the more recent updates to the JavaScript language, ES6, introduced the concept
Javascript: var, const, let, What’s The Difference?
In The Beginning, There Was var Not so long ago, back in the days of ES5, there was only one keyword used to define a variable: var. Var has two possible types of scope: function scope and global scope. The following example demonstrates this: Variable declarations with var can trip