base.rank is 1, and item inherits from base without defining rank itself. What does Object.hasOwn(item, "rank") return?
Explanation
Object.hasOwn examines only properties belonging directly to the supplied object, so an inherited rank does not qualify. A true result based on prototype lookup would describe the in operator instead.