有没有一种方法可以迭代对象的属性和方法?我需要编写一个类似于以下的实用函数:
有什么想法吗?
function iterate(obj)
{
//print all obj properties
//print all obj methods
}
所以运行这个函数:
iterate(String);
将会打印:
property: lenght
function: charAt
function: concat...
有什么想法吗?