what exactly this code is doing
<p>Based on this answer - <a href="http://stackoverflow.com/questions/3778647/how-to-change-classes-on-click">http://stackoverflow.com/questions/3778647/how-to-change-classes-on-click</a>
can somebody explain me what exactly the code below is doing?</p>

<pre><code>$("a").click(function() {
  var $this = $(this); // this is just for performance
  if(!$this.hasClass('yy'))
    $('.yy').toggleClass("yy").toggleClass("xx");
  $this.toggleClass("yy").toggleClass("xx");
});
</code></pre>

<p>I mean the last two lines.</p>
