The `hasOwnProperty` test is probably unnecessary. A truthy check should suffice.