Use hasOwnProperty for objects.