How to get function name in strict mode [proper way]

后端 未结 2 432
耶瑟儿~
耶瑟儿~ 2021-01-13 08:33

arguments.callee unfortunatelly deprecated, and using it throws an error in \"strict mode\".

Is there any new proper(standard) alternative for getting functi

2条回答
  •  渐次进展
    2021-01-13 08:57

    Is there any new proper (standard) alternative for getting function name inside actual function?

    No, there is not.

    Or will it be in future plans for ES?

    No, given that there is no need for it. Inside the current function, you know the name and could just as well use a string literal, in other functions you just need some reference (but not .callee).

提交回复
热议问题