您现在的位置:首页 >> 前端 >> 内容

Object.key()与for...in...

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

  核心提示:The Object.keys() method returns an array of a given objects own enumerable properties, in the same ...

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…会遍历原型链上的键值。

Tags:OB BJ JE EC 
作者:网络 来源:coderMozar