How to use Array reduce() with objects

In my javascript code occasionally I have to loop through an array of objects, and keep a running total of one of their properties. Imagine having an array of objects such as: And you want to have a total sum…

Updating Node JS from NPM

Normally, you would have to visit the Node JS website to download an updated version of Node. This can be a bit slow and a pain. Why can’t Node JS update itself if you want it to? Well here’s a…

What’s the unary + operator?

During development recently I’ve been seeing statements like this in Javascript: What’s that plus (‘+’) symbol doing there, before the ‘new’¬†operator? Strangely, it wasn’t trivial to find out on google, as I only knew the symbol not the name, but…

Monkey Patching Dojo modules

New trick I learned today, monkey patching in Dojo! Using this method, I was able to extend the capabilities of an existing Dijit module without having to extend it first. I used this technique to patch Dijit/Dialog. This way, I…