title: Adding custom properties to a function
body: <p>Searching for appropriate answer proved difficult because of the existence of many other problems related to my keywords, so I'll ask this here.</p>
  <p>As we know, functions in JavaScript are objects and they have their own properties and methods (more properly, function instances, inherited from Function.prototype).</p>
  <p>I was considering adding custom properties for one function (method), let's skip the &quot;why?&quot; part and go straight to the code:</p>
  <pre><code>var something = {
      myMethod: function () {
          if (something.myMethod.someProperty === undefined) {
              something.myMethod.someProperty = &quot;test&quot;;
          }
          console.log(something.myMethod);
      }
  }
  </code></pre>
  <p>When inspected with Firebug's DOM explorer, the property is defined as expected. However, as I don't consider myself a JavaScript expert, I have the following questions:</p>
  <ol>
  <li>Can this method be considered &quot;proper&quot; and standards compliant? It works in Firefox but there are many things working as expected in web browsers and aren't by any means standards.</li>
  <li>Is this kind of altering objects by adding new properties to them a good practice?</li>
  </ol>