Why didn't `obj.hasOwnProperty(key)` work?