ES6: arrow functions
ES6 provides a new way to create functions using the =>
operator. These functions are
called arrow functions. Arrow functions have a shorter, more concise syntax.
ES6: spread operator and rest parameters
The ES6 spread operator and rest parameter is represented by the ...
token. The usage of this
token will determine if it’s a spread or rest operation.
ES6: default parameters
ES6 provides a new syntax to assign default values to function parameters. You might be familiar with this concept from languages like Ruby, PHP or C++ and it’s about time that this was baked into the language.
ES6: let and const
ES6 introduces the new let
and const
keywords. Up until ES5, Javascript only had function scope and global scope. The let
keyword makes it possible to declare block scoped variables.
This blog post explores function scope, block scope and how it relates to the let
and const
keywords. It also briefly discusses
something known as the Temporal Dead Zone (TDZ).
Before we get to block scope let’s talk a little about function scope.
New blog
I finally took some time out this weekend to create a new blog. I was initially using octopress but it had way more features than I needed. I decided to go with Jekyll, a simple static site generator.