How to Print Function Signature in javascript

后端 未结 3 1989
再見小時候
再見小時候 2021-02-02 10:08

I have a function:

fs.readFile = function(filename, callback) {
    // implementation code.
};

Sometime later I want to see the signature of th

3条回答
  •  悲哀的现实
    2021-02-02 10:26

    I am not sure what you want but try looking at the console log of this fiddle, it prints entire function definition. I am looking at chrome console.log output.

    var fs = fs || {};
    fs.readFile = function(filename, callback) {
      alert(1);
    };
    console.log(fs.readFile);
    

    DEMO http://jsfiddle.net/K7DMA/

提交回复
热议问题