Hm, maybe I misunderstood what
jQuery() actually does. I thought it searches the DOM using the given selector and returns a set of fitting jQuery objects. If that is true
$('.dropdown-button.active').hasClass("active") will cause a search in the DOM just as
$('.dropdown-button.active').removeClass("active") does. So a DOM search will be performed in both solutions when a click on the document is registered (in your example even twice).
Or am I missing something elemental?