JavaScript - function as an object property
<p>Hey everyone, this is  #23 from John Resig Advanced JavaScript <a href="http://ejohn.org/apps/learn/#23" rel="nofollow">http://ejohn.org/apps/learn/#23</a>, called </p>

<blockquote>
  <p><code>What happens if a function is an
  object property.</code></p>
</blockquote>

<p>1) regarding vocabulary,  the variable katana is the object, right? If the anonymous function is its property, then what is "use" called? I thought "use" would have also been called a property? or is "use" also an object because it contains a value, namely a function?</p>

<p>2). Is the purpose of the function to change isSharp: true to isSharp: false?  What does !this.isSharp exactly do? </p>

<p>3) When it asserts !katana.isSharp, what is it actually asserting? that isSharp has now been set to  "false"? </p>

<pre><code>var katana = {
  isSharp: true,
  use: function(){
    this.isSharp = !this.isSharp;
  }
};
katana.use();
assert( !katana.isSharp, "Verify the value of isSharp has been changed." );
</code></pre>
