Exploring ES6

ES6 or ES2015, whatever you call it, is all the rage right now.

And for no small reason. ES6 brings a slew of new features and improvements to javascript land that are long overdue.

Instead of going through all of them, I invite to check out the last chapter of the amazing book series You don’t know JS, ES6 & Beyond, that’s on Github.

It cover almost anything you would want to know about the new ES6 in a much more succinct and thorough way that I possibly could.

My personal favourite of all the goodness however has to be the new Arrow Functions, which are very remisnect of C#’s Lambda expressions.

Long story short, it means:

let random = function() {
	return 4;
//can be written as this
let random = () => 4;

//here's an ever cooler example
let randomNum = random();

//this IIFE (a function that executes immediately)
(function(x) {
})( randomNum );
//prints 4

//can be written as this
( (x) => console.log(x) )(random()) 
//prints 4

Go back.