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

# 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._
