在js中遍历(任意)未知的对象。

把 yourFunction 替换为,你想打印的函数。

let description = ""; 
for(let i in yourFunction){ 
	let property = yourFunction[i]; 
	description += i + " = " + property + "\n"; 
} 
console.log(description); 

转载自https://www.cnblogs.com/focusxxxxy/p/6428764.html

猜你喜欢

转载自blog.csdn.net/chanlingmai5374/article/details/84670701
今日推荐