Replacing _.has with hasOwnProperty