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

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