草庐IT

getAllFunctions

全部标签

javascript - 返回 Javascript 文件中定义的所有函数

对于下面的脚本,我如何编写一个函数,将脚本的所有函数作为一个数组返回?我想返回脚本中定义的函数数组,以便打印脚本中定义的每个函数的摘要。functiongetAllFunctions(){//thisisthefunctionI'mtryingtowrite//returnallthefunctionsthataredefinedinthescriptwherethis//functionisdefined.//Inthiscase,itwouldreturnthisarrayoffunctions[foo,bar,baz,//getAllFunctions],sincethesear