title: Passing a function as parameter in javascript, undefined error
body: <p>I have a function which is part of an object called <code>server</code>, i.e server.log is a function which I use to log data. There are other properties of server which I do not want to pass to other functions, though I want server.log to be available to functions in other files.</p>
  
  <pre><code>function test() {
      testingThis(server.log);
  }
  
  function testingThis(logf) {
      logf("test123");
  }
  </code></pre>
  
  <p>I get an error saying </p>
  
  <blockquote>
    <p>Cannot read property 'emit' of undefined</p>
  </blockquote>
  
  <p>I am using happy console module to log (server.log works fine in test function).</p>