How to wait for the elements' animation queues for a given queue name to get empty?

Compact syntax with timing methods:

1 $('.some').join(queue,true).doSome().jQueryStuff();

Due to a bug in jQuery this feature doesn't work up to jQuery 1.8.0.

Compare this to the old way with more syntactic fluff:

1 $('.some').promise(queue).then(function(){
2   $('.some').doSome().jQueryStuff();
3 });

Similar patterns with animations

Similar patterns with promises