jQuery which is faster, hasClass or .length?

Out of curiosity I had a search around for which usages would be quicker:

$('#wrapper').hasClass('sidebars');

Or

$('#wrapper.sidebars').length > 0;

As it happens the guys over at JsPerf have already worked it out, which is a good chance to introduce this excellent resource of js based performance tests:

http://jsperf.com/jquery-selector-vs-hasclass
http://jsperf.com/browse

So the bottom line? Go with .hasClass();!