Chrome控制台:显示功能属性

时间:2013-11-26 11:33:47

标签: google-chrome console google-chrome-devtools

我希望在控制台中看到函数作为对象。例如,如果我写

Object

它告诉我

function Object() { [native code] }

但我想要像

这样的东西
{bind: function(){...}, call: function(){...}, hasOwnProperty: function(){...}, ...}

如何在Chrome控制台中执行此操作?

2 个答案:

答案 0 :(得分:2)

console.dir(Object)

显示

▶ function Object() { [native code] }

可以扩展

arguments: null
caller: null
create: function create() { [native code] }

答案 1 :(得分:1)

IT不清楚为什么需要这个,但有一个解决方法。你可以在最后写点,看看完整的建议列表。对于文本window.getElementById。 devtools使用apply,arguments,bind,call,caller,constructor,hasOwnProperty等显示列表。