Fuck callbacks! Let’s use generators

Let’s write a simple function hello that return a string when called. var hello = function () { return 'Hello ' + name; } Now convert it into a generator. Call hello() this time will return you an Object instead: the generator. var hello = function *() { return 'Hello ' + name; } Let’s consider the following snippet. var hello = function *() { yield 'Stopped here!'; return 'Hello ' + name; } var generator = hello('Clark Kent'); console.
Read more →

bluebird - a promise library with unmatched performance

The documentation of bluebird is so much better than Q - the library which I’m currently using. bluebird with nodejs is even better: it can convert an existing promise-unaware API to promise-returning API which is so awesome. Thid feature works with most popular libraries (which use error as first arg (as they all should)). I’m sold!! Usage # function getConnection(urlString) { return new Promise(function(resolve) { //Without new Promise, this throwing will throw an actual exception var params = parse(urlString); resolve(getAdapater(params).
Read more →

jQuery Tips and Tricks

Compilation of jQuery tips and tricks by StackOverflow members
Read more →

Things you may not know about JavaScript array

Some fun (weird) stuff about JavaScript array.
Read more →