`hasOwnProperty` is unnecessary as `Object.keys()` doesn't include properties of the prototype chain.