Javascript

Cleaning up promises with yield

Previously we looked at cleaning up callback hell with thunks and generators, but in this post we'll look at the next approach to managing callbacks, Promises, and how we could clean that up with generators.
January 2014 · 5 minute read
Read Post

Cleaning up callbacks with yield

We'll continue our exploration into the new `yield` and have a look at how it can be used to avoid the so-called callback hell which can plague JavaScript applications.
January 2014 · 7 minute read
Read Post

Functions that yield multiple times

Generator functions in ES6 don't have to just do a single `yield`, they can `yield` multiple times, but when doing so how do you execute those functions?
January 2014 · 9 minute read
Read Post

LINQ in JavaScript, ES6 style

It's been a few years since I last blogged about the concept of LINQ in JavaScript as a lot has changed in the JavaScript landscape. So let's revisit the idea of it with a look at how you could leverage LINQ in JavaScript for ES6.
September 2013 · 8 minute read
Read Post

AJAX without jQuery

When was the last time you wrote an AJAX request? When was the last time you did it without relying on jQuery? In this article we'll look at how do do just that, how do make an AJAX request without jQuery to better understand what's going on.
August 2013 · 5 minute read
Read Post

Array-like objects

Just because it looks like a duck, walks like a duck, quacks like a duck doesn't mean it's a duck. There's dangers with making assumptions of your JavaScript objects based on their surface area. That said, a lot of power can be gleamed by these seemingly innocent assumptions.
July 2013 · 4 minute read
Read Post

Implementing "indexers" in JavaScript

My colleague Luke Drumm challenged me to implement C# style indexers in JavaScript. So let's have a look at how you can do that, and how you can make some very interesting JavaScript objects that are self replicating. We'll build on the knowledge of using `bind` and `apply` from the last two posts.
July 2013 · 6 minute read
Read Post

JavaScript bind, currying and arrow functions

After confusing my colleagues with how to invoke functions with a modifided set of arguments at a single time the next evolutionary point was to confuse them with creating functions that are always called with a different state.
July 2013 · 4 minute read
Read Post

JavaScript call and apply

After having confused one of my colleagues with some code that used the JavaScript `apply` method and giving them an answer that didn't leave them completely bemused I thought I'd share my explanation with the world.
July 2013 · 4 minute read
Read Post

Walking a JavaScript object

Ever had a path to a path to a property on a JavaScript object that you want to walk? Something along the lines of `foo.bar.baz`. Recently I was trying to solve this problem and came across a nifty little trick
June 2013 · 2 minute read
Read Post

Hello mathy

An introduction to another new library from me, this time it's mathy, a simple formula parser
January 2013 · 4 minute read
Read Post