toggle function with ! in jquery
<p>I'm reading someone's source code for their backbone app and trying to figure out this toggle function. I understand the basic of toggle is that it just switches back and forth between a setting. In the example below, it sets the favorite on a model (indicating if it's a favorite or not, I assume).  I also understand the use of <code>!</code> (meaning not). However, I don't get the logic of how this function works. </p>

<pre><code> toggle: function() {
      this.save({favorite: !this.get("favorite")});
    },
</code></pre>

<p>In particular, I don't get the</p>

<pre><code>!this.get("favorite")
</code></pre>

<p>Isn't <code>this.get("favorite")</code> returning a string, namely "favorite"? or is this.get("favorite") returning the attribute which is a boolean?</p>

<p>Can someone kindly explain in plain english how the logic of this function works each time it would be called, toggling between the two states. </p>
