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