2
是否有任何函數可用於列出node.js中所有當前定義的函數?我想創建這樣的函數:獲取node.js中當前定義的函數列表
function getAllDefinedFunctions(){
//return all the functions that are currently defined
}
是否有任何函數可用於列出node.js中所有當前定義的函數?我想創建這樣的函數:獲取node.js中當前定義的函數列表
function getAllDefinedFunctions(){
//return all the functions that are currently defined
}
可以在this
(全局對象)在所有屬性中使用for/in
循環來檢查typeof this[name]
是否'function'
。
你能提供一個例子嗎? –
我意識到我做了我自己的問題的副本:http://stackoverflow.com/questions/11279441/return-all-of-the-functions-that-are-defined-in-a-javascript-file –