---
name: "up.Layer.prototype.index"
area: "API"
kind: "Property"
parent: "up.Layer class"
url: "https://unpoly.com/api/up.Layer.prototype.index"
---
<nav aria-label="Unpoly docs">[All docs](https://unpoly.com/index.md) · [up.Layer class](https://unpoly.com/api/up.Layer.md)</nav>

# up.Layer.prototype.index

Returns the zero-based position of this layer in the [layer stack](https://unpoly.com/api/up.layer.stack.md).

The [root layer](https://unpoly.com/api/up.layer.root.md) has an index of `0`, its child overlay has an index of `1`, and so on.

This property has no defined behavior for layers that are [closed or are being closed](https://unpoly.com/api/up.Layer.prototype.isAlive.md).

---

## Return value {#return-value}

index The position of this layer in the stack.

Type: number

