Content tagged as 'Ecma-Script-5'

Here is a list of all the content that has been tagged as ecma-script-5.

Node.js Asynchronicity and Callback Nesting

Redirects to legacy blog post.

AKA callback hell, temple of doom, often the functions that are nested are anonymous and often they are implicit closures. When it comes to asynchronicity in JavaScript, callbacks are our bread and butter. In saying that, often the best way to use them is by abstracting them behind more elegant APIs.

Exploring JavaScript Prototypes

Redirects to legacy blog post.

My intention with this post is to arm our developers with enough information around JavaScript prototypes to know when they are the right tool for the job as opposed to other constructs when considering how to create polymorphic JavaScript that’s performant and easy to maintain.

Exploring JavaScript Closures

Redirects to legacy blog post.

Now establishing the formal definition has been quite an interesting journey, with quite a few sources not quite getting it right. Although the ES3 spec talks about closure, there is no formal definition of what it actually is. The ES5 spec on the other hand does discuss what closure is in two distinct locations.

JavaScript Object Creation Patterns

Redirects to legacy blog post.

What are the differences in creating an object by way of simple function invocation, vs using a constructor vs creating an object using the object literal notation vs function application?

JavaScript Properties

Redirects to legacy blog post.

In ECMAScript 5 we now have two distinct kinds of properties.

  • Data properties
  • Accessor properties

Extending, Currying and Monkey Patching part 3

Redirects to legacy blog post.

Monkey Patching, or sometimes known as Duck Punching.

Extending, Currying and Monkey Patching part 2

Redirects to legacy blog post.

Currying got it’s name from Haskell Curry, originally discovered by Moses Schönfinkel. The programming language Haskell named after Haskell Curry is a purely functional language. So the concept of Currying has it’s roots in functional programming. It seems that the concepts of Currying and Partial Function Application are often used interchangeably, although they are different. Lets try and shed some light on the confusion.

Extending, Currying and Monkey Patching part 1

Redirects to legacy blog post.

Extending: The JavaScript Function.prototype.call and Function.prototype.apply methods allow us to extend an object with additional functionality…