# Property descriptors

Property descriptors are [standard JavaScript property descriptors](https://mdn.io/defineProperties). They are applied last thing when an object instance is being created. See more info in [stamp internals](/essentials/specification/object-creation-internals.md).

```javascript
const Key = stampit.props({
  key: 'my secret key'
})

const auth = Key()
auth.key === 'my secret key'
auth.key = 'ha ha ha'
auth.key === 'ha ha ha' // oops :(

const FrozenKey = stampit.propertyDescriptors(Key, { // composing the two
  key: { // this is a standard JavaScript property descriptor
    configurable: false,
    writable: false,
  }
})

const auth = FrozenKey()
auth.key === 'my secret key'
auth.key = 'ha ha ha'
auth.key === 'my secret key' // OK!!! The "key" was not overwritten.
```

The code above adds some more metadata to the `Key` stamp. It protects the `key` property from overwrites

## Other ways to add property descriptors

Exactly the same stamp can be created in few ways. Here they all are.

```javascript
const keyPropertyDescriptor = {
  key: {
    configurable: false,
    writable: false,
  }
}

const FrozenKey = stampit({
  propertyDescriptors: keyPropertyDescriptor
})

const FrozenKey = stampit.propertyDescriptors(keyPropertyDescriptor)

const FrozenKey = stampit().propertyDescriptors(keyPropertyDescriptor)
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://stampit.js.org/api/property-descriptors.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
