Let's assume this use case:
- add component with entityId = 1
- destroy entity with entityId = 1
- getComponent with entityId = 1
const entityId = createEntity();
addComponent(
entityId,
new Position({ x: 0, y: 0 }),
);
destroyEntity(entityId);
console.log(world.entities, world.components);
const entity = getComponent({ position: Position })(entityId);
console.log('exists', entity !== undefined, entityId);
result
world.entities does not contain entityId = 1, but it still exists in components