title: Return all of the functions that are defined in a Javascript file
body: <p>For the following script, how can I write a function that returns all of the script's functions as an array? I'd like to return an array of the functions defined in the script so that I can print a summary of every function that is defined in the script.</p>
  
  <pre><code>    function getAllFunctions(){ //this is the function I'm trying to write
          //return all the functions that are defined in the script where this
          //function is defined.
          //In this case, it would return this array of functions [foo, bar, baz,
          //getAllFunctions], since these are the functions that are defined in this
          //script.
      }
  
      function foo(){
          //method body goes here
      }
  
      function bar(){
          //method body goes here
      }
  
      function baz(){
          //method body goes here
      }
  </code></pre>