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

# up.util.pluckKey(object, key)

Deletes the property with the given key from the given object and returns its value.

---

## Parameters {#parameters}

### object {#object}

(required)

The object from which to pluck a property.

Type: [Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Working_with_Objects)

### key {#key}

(required)

The name of the property to pluck.

Type: string

---

## Return value {#return-value}

The value of the property before it was deleted.

If the object didn't have the property, returns `undefined`.

Type: any

