ES6 – 5 Songs That Are Now About ECMAScript6.

music is now ES6

On my block – Scarface

let will never leave his block. Unlike his brother var, whose fancy ways lure him to live the function-scoped lifestyle, let is loyal to his block, be it an if, for, while, or even an arbitrary set of brackets {}. Sometimes a variable should never leave its block, never venture past the brackets to the outer scope. Anyways, there’s plenty to do on let’s block, plenty to shape a young let on the streets stuntin’.

Constants are Changing – Boards of Canada

Constants aren’t changing anymore. let’s nebulous older brother const is read-only, but he’s still on the block. const holds a special value over his block, a value that cannot and will not change. He refuses to be redeclared and will not let anything in his scope use his name. This gives const a sort of spectral quality. While the lets run around wavering, const stands stoic, manipulating processes around him on the merit of his resolute value.

Blazing Arrow – Blackalicious

Phase your days your hazy ways with a blazing arrow function. Ever feel bogged down by JavaScript’s inclination to redefine this in every function’s scope? Ever feel like your function expressions are as wordy as Blacklicious bars? Well ES6 has your back with the blazing arrow. You may recognize him from C# or Java or Coffeescript, but finally, he has entered the halls of JS. Every JavaScript noob has struggled finding this in an async callback. The Arrow brings it right to you.

Class Historian – BRONCHO

Mmm, that sweet class sugar is here. The class historian may point out that JS classes are mearly prototyical objects painted like OO classes, but that doesn’t change the fact that the new JS class keyword is dope and makes leveraging inheritence a breeze. class brought friends too. With extends, prototypical subclasses are easier than ever to coalesce, and we can finially leverage super() to go up that chain and throw in some gets and sets.
And, JS classes work great as React components.

Promise – Ciara

The Promise’s love is deep. She will never lie to you. She will never make you feel the pain of inversion of control. Even if her value isn’t instantaneously avaliable, it will be. No lie. When she’s ready, then() she will deliver wholehearted fulfillment, smiling resolution. Hopefully, you won’t ever have to catch() her any throwing any errors, but if you did, just remember, it probably wasn’t her fault. There’s always more to the story, and there’s no use overreacting and taking out your frustration on sweet Promise.

Generator 3.4 – Mogi Grumbles

Generator functions have landed. They mostly look like any other function expression, so you gotta look closely to make them out. One can distinguish these alien creatures from other functions by the * drawn on their foreheads, or, if you’re feeling surgical, by the yield keywords in their bodies. These beings are controlled by an external next() call, they call their iterator. The generator pauses mid completion, keeping its state at yield, until hit with another next(). They live, but you may have to use .value to see them, and they are here to distribute their extraterrestrial tech that makes earthly async code look synchronous and sequential.

If you read this far, it’s pretty clear that, like us at Revelry Labs, you’re partial to songs about JavaScript. You should probably check out the original mixtape. If you like reading about connections between Music and Coding check out these other posts : Music <> Coding & Facesynth : API driven Noise Making.