# EntityStore: count property

> The count read-only property of the EntityStore interface is the number of entities the client holds.

The **`count`** read-only property of the [`EntityStore`](/docs/client/entity-store) interface is the number of entities the client holds.

## Value

A whole number. It counts every entity the client holds: the shared state, its private state, a presence entry for each player in the room and the room's entities in its view.

## Description

A seated player in a room of four, with one entity of its own in view, has a `count` of 7: the shared state, its private state, four presence entries and its entity.

The room's [`entities.count`](/docs/room/entities/count) counts only the room's entities, so the two differ. To count one kind, spread [`all()`](/docs/client/entity-store/all) into an array.

## Examples

### Showing how much the client holds

A debug overlay shows the number of entities the client holds, next to the number of cards it sees.

```ts
// overlay.ts
import { connect, defineSchema, entity } from "@irtio/client";

const Card = entity("card", { suit: "u8", rank: "u8" });
const schema = defineSchema({ entities: [Card] });

const room = await connect("table-12", { schema });

room.addEventListener("update", () => {
  console.log(`${room.entities.count} entities, ${[...room.entities.all(Card)].length} cards`);
});
```

## See also

- [`EntityStore.all()`](/docs/client/entity-store/all)
- [`Entities.count`](/docs/room/entities/count), the room's side
