0

Doing the following in node.js with express.js

const callFn = (param) => param;
console.log(callFn);

expecting to get:

(param) => param

instead, I get:

[Function: callFn]

How do I actually get the expected results?

  • @Ctac Thanks, but that doesn't seem related. If you know how to actually get the expected results, please post you solution, would be happy to see it. – WebrJohn Apr 15 '23 at 13:47
  • @Ctac Of course I make it a function, but what makes you think I shouldn't be able to output the expression? JavaScript treat functions as first-class citizens. – WebrJohn Apr 15 '23 at 14:00
  • Why do you expect logging a function object to give you the source code of the function? – Quentin Apr 15 '23 at 14:22

0 Answers0