Retrieve all the names of the object's properties.
返回对象的所有的属性名称
1 _.keys({one : 1, two : 2, three : 3}); 2 => ["one", "two", "three"]
源码:
1 _.keys = nativeKeys || function(obj) { 2 if (obj !== Object(obj)) throw new TypeError('Invalid object'); 3 var keys = []; 4 for (var key in obj) if (_.has(obj, key)) keys[keys.length] = key; 5 return keys; 6 };