Object.keys
looks up all own, enumerable properties (oh, and arrays are fast).for in
additionally looks up inherited enumerable properties, not only own onesfor in
+hasOwnProperty
additionally tests all looked up properties for whether they are own properties.
Even if there are no inherited enumerable properties, it is still more work to do than not.