您的位置:首页 > 移动开发 > Objective-C

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

2017-02-12 01:00 302 查看
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…会遍历原型链上的键值。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐