Arrow Function Syntax

The next version of JavaScript - called ES2015 (née ES6) - has just shipped. It’s final, so there won’t be any semantic or syntactic changes. What there will be are plenty of great features that coming to a JavaScript engine near you. Soon.

Even for engines that don’t implement ES2015 yet, you can use Babel to compile lots of those features into valid ES5 (the previous generation of JavaScript). This lets you run code levering the new goodness in all modern browsers, Node.js and most other places where JavaScript is used.

I’m a programmer who uses functions like a preschooler uses glitter, so arrow functions is one of the features I’m really excited about. Here’s what I’ve learnt from reading the specification, reading forum discussions and testing things out in the Babel playground.

read more...

Why Curry Helps

A programmer’s pipe-dream is to write code, and be able to use it repeatedly with little effort. It’s expressive because you write in a way that expresses what is needed, and it’s reuse because.. well, you’re reusing. What more could you want?

curry can help.

read more...

Vars And Values

Sometimes I hear JavaScript dev throw around the terms vars and values as synonyms for each other. Realising that they’re not was a serious ‘aha’ moment for me - and making the distinction about it can make talking and thinking about code clearer by far.

read more...

Tapping Into The Method Chain

Objects and methods are a big deal. They’re the core way in which JavaScript defines functionality against a type; which is reflected in the standard library, in many of the libraries we choose to use, and how production code tends to be written (at least, in my experience).

Compare these two solutions for returning the name of all the audiophiles in a contact book:

read more...

Jslint Is Not A Code Quality Tool For 3rd Party Code

Doug Crockford’s JSLint performs static analysis on Javascript, returning a list of what Crockford considers to be violations of best practice. Contrary to the assertions of its creator, however, it is not a fit tool by which to judge the quality of 3rd party code.

read more...