tl;dr
In the end the guy who considers himself a hipster engineer wrapped the stuff into if statement:
clearMenus()
if (!isActive) $parent.toggleClass('open')
Furthermore he twitted that "The only reason I [fat] don't use semicolons is to troll people."