在Google Chrome控制台中,如果我输入fn
,其中fn
是一个函数,那么我会得到fn
的代码.在 node 控制台中,键入require.resolve
即可打印出来
[Function]
为什么我得不到函数定义?
在Google Chrome控制台中,如果我输入fn
,其中fn
是一个函数,那么我会得到fn
的代码.在 node 控制台中,键入require.resolve
即可打印出来
[Function]
为什么我得不到函数定义?
根据 comments :使用fn.toString()
.