Replace in with hasOwnProperty