title: Assigning a function as another function's property
body: <p>Why does this work:</p>
  
  <pre><code>var myFunction = function() {}
  
  myFunction.printSomething = function() {
      console.log("This is something");
  }
  
  myFunction.printSomething();
  </code></pre>
  
  <p>While this doesn't? ("Identifier expected" problem)</p>
  
  <pre><code>var myFunction = function() {
      printSomething: function() {
          console.log("This is something");
      }
  }
  
  myFunction.printSomething();
  </code></pre>
  
  <p>Am I actually successfully creating a new printSomething property of the myFunction function object in the first example? I was expecting both to work given that functions are supposedly objects in javascript. Am I understanding this wrong?</p>