get-function-name-x
Get the name of the function.
Version: 2.0.4
Author: Xotic750 Xotic750@gmail.com
License: MIT
Copyright: Xotic750
module.exports(fn) ⇒ undefined | string ⏏
This method returns the name of the function, or undefined if not
a function.
Kind: Exported function
Returns: undefined | string - The name of the function, or undefined if
not a function.
| fn | function | The function to get the name of. |
Example
var getFunctionName = require('get-function-name-x');
getFunctionName();
getFunctionName(Number.MIN_VALUE);
getFunctionName('abc');
getFunctionName(true);
getFunctionName({ name: 'abc' });
getFunctionName(function () {});
getFunctionName(new Function ());
getFunctionName(function test1() {});
getFunctionName(function* test2() {});
getFunctionName(class Test {});