站内搜索:
首页 >> 前端 >> 内容
Object.key()与for...in...

时间:2017/2/13 9:21:34

The Object.keys() method returns an array of a given object’s own enumerable properties, in the same order as that provided by a for…in loop (the difference being that a for-in loop enumerates properties in the prototype chain as well).

意思是说Object.key()返回一个数组不会遍历原型链上的键值,而for…in…会遍历原型链上的键值。

  • 上一篇:readyState的5种可能
  • 下一篇:Apache服务器配置及部署
  • 返回顶部