Posts tagged with "javascript"

My JavaScript reading list

February 23rd, 2012

Of late, quite a few people have been asking me for good resources to learn JavaScript in a structured way. Over the past few years, I have amassed quite a few good links, so I decided to write a quick post highlighting some of them. I can just point people to this post in future! [...]


Currying in JavaScript using bind()

February 6th, 2012

Currying, or more accurately, partial application is the process of breaking down a function that takes multiple arguments into a series of functions that take parts of the arguments. It comes in handy whenever you don’t have all the required arguments to a function at the present time. For example, consider a function add that [...]


Thoughts on Socket.IO

January 30th, 2012

I have been hacking away with Socket.IO for the past few months. My initial goal was to explore how Node.js/Socket.IO scales when you need to support a largish audience, when compared to my previous solutions involving Erlang/OTP and a handmade COMET library. I have built these COMET based streaming solutions by hand a few years [...]


First element of an object in JavaScript

January 17th, 2012

This one will go into the bag of clever hacks which you should use sparingly, if not ever. Given an object like this: var obj = { a: "foo", b: "bar", c: "baz" } Here’s how we get the “first” property of the object/dict: for (var first in obj) break; console.log("First property is: "+first); We’re [...]


ECMAScript harmony features in Chrome Canary

December 26th, 2011

The latest Canary build of Google Chrome allows you to unlock some new features from ECMAScript Harmony. However, they are disabled by default, so to enable them you have to type about:flags into your address bar, and turn on “Enable Experimental JavaScript” which is found right at the bottom of the page. Now, you have [...]