title: how to get properties and methods of a function?
body: <blockquote>
    <p><strong>In JavaScript, functions are first-class objects, because they can have properties and methods just like any other object</strong><br><br>
    Ref: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions" rel="nofollow noreferrer">Functions</a></p>
  </blockquote>
  
  <p><br><em>Therefore, how to get the function methods and properties, as simple objects can caught in <code>console.log(testObj)</code>, all the details will goes into the browser console.</em><br>
  <em>As it is, how to get the function <strong>object details</strong>.</em></p>
  
  <p><br><strong>Trying to get function details:</strong></p>
  
  <pre><code>function foo() {
      var a = 2;
      return a;
  };
  
  console.log(foo);
  </code></pre>
  
  <p><em>Above just returns the signature, <code>function foo()</code>.</em></p>
  
  <p><strong>Example: <code>console.log(document);</code></strong></p>