---
name: "up.layer.count"
area: "API"
kind: "JavaScript property"
parent: "up.layer module"
url: "https://unpoly.com/api/up.layer.count"
---
<nav aria-label="Unpoly docs">[All docs](https://unpoly.com/index.md) · [up.layer module](https://unpoly.com/api/up.layer.md)</nav>

# up.layer.count

Returns the number of layers in the [layer stack](https://unpoly.com/api/up.layer.stack.md).

The count includes the [root layer](https://unpoly.com/api/up.layer.root.md). Hence a page with a single overlay would return a count of 2.

---

## Value {#value}

### count {#count}

The number of layers in the stack.

Type: number

