---
schema_version: "1"
id: 66dd20c60c58bc77efc63b2e6aa3f3c70f7f0b19292fcecf094b04e0e8eb985d
title: namesOf
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/dataweave/2.11/dw-core-functions-namesof.md
canonical_url: https://docs.mulesoft.com/dataweave/2.11/dw-core-functions-namesof
source_site: docs.mulesoft.com
content_type: documentation
content_hash: e6eb3f21c77e9b735755ca05227ac2eec8464cb486a156ce72239e7b3d6805eb
description: MuleSoft Documentation Site
release: "2.11"
latest: false
---
---
product: DataWeave
version: 2.11
---

# namesOf

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

## namesOf(obj: Object): Array<String>

Returns an array of strings with the names of all the keys within the given object.

_Introduced in DataWeave version 2.3.0._

### Parameters

<table><colgroup><col> <col></colgroup><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><p><code>obj</code></p></td><td><p>The object to evaluate.</p></td></tr></tbody></table>

### Example

This example returns the keys from the key-value pairs within the input object.

#### Source

```DataWeave
%dw 2.0
output application/json
---
{ "namesOf" : namesOf({ "a" : true, "b" : 1}) }
```

#### Output

```JSON
{ "namesOf" : ["a","b"] }
```

## namesOf(obj: Null): Null

Helper function that enables `namesOf` to work with a `null` value.

_Introduced in DataWeave version 2.4.0._
