How to detect a JavaScript function with a certain signature has been registered?

后端 未结 4 1174
抹茶落季
抹茶落季 2021-02-02 01:38

Say you have two functions with the following signatures:

  1. addClass( class )
  2. addClass( class, duration )
4条回答
  •  广开言路
    2021-02-02 02:01

    If you are using node you can use func.toString() and parse the result to get the signature that was being used.

提交回复
热议问题