在JavaScript中列出所有内建函数? [英] List all built-in functions in javascript?
本文介绍了在JavaScript中列出所有内建函数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
编辑:
Math.sin等功能实际上是我想要的功能列表,实际上是所有内置函数。
解决方案
类似这样的事情,也许?
for(var x in window){
if(window [x] instanceof Function)console.log(x);
$ b $ p
$ b这将列出控制台中的所有原生函数(不包括原生对象中的原生函数,如 Math.sin()
)。
Is there a way in js to list all the builtin functions and some info on their parameterlists? I couldn't really find anything about reflection to do this sort of thing
edit:
The functions such as Math.sin are actually the ones I want to list, actually all built-in functions.
解决方案 Something like this, maybe?
for( var x in window) {
if( window[x] instanceof Function) console.log(x);
}
This will list all native functions in the console (excluding one in native objects, such as Math.sin()
).
这篇关于在JavaScript中列出所有内建函数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文