title: console.log() returns undefined when I specify a function as its argument
body: <p>I'm trying to make a site for students that will allow them to input javascript, run the code, and test the code against expected outputs.
  I'm having a little bit of trouble using the Function() constructor to run the code that I get from the text input space.</p>
  
  <p>A button is pressed to run submitcode()</p>
  
  <pre><code>  function submitcode(){
      $(document).find('textarea,:text').each( function(){
        var codewritten = $(this).val();
        console.log(codewritten);
        test(codewritten);
      });
    }
  </code></pre>
  
  <p>the test method is here:</p>
  
  <pre><code>  function test(inputcode){
      var passed = inputcode; //code that they wrote
      var args = 'pogchamp'; //this is my input that i want to test their code with
      var f = new Function('a',passed);
      console.log(passed);
      console.log('test');
      console.log(f(args));
    }
  </code></pre>
  
  <p>When I check chrome output, the value of passed shows up properly, as does 'test', while console.log(f(args)); returns undefined.</p>
  
  <p>Here is a sample value of the passed variable, just for reference:</p>
  
  <pre><code>   function foo(str){
         return false; //auto-generated
     }
  </code></pre>
  
  <p>Thanks, and sorry (I'm relatively new to javascript)</p>