# Object

* [`keys`](/angular-pipes/documentation/object.md#keys)
* [`toArray`](/angular-pipes/documentation/object.md#toarray)
* [`defaults`](/angular-pipes/documentation/object.md#defaults)

You can check the module import [`here`](/angular-pipes/documentation/modules.md).

## keys

Returns the array of keys of the given object or array.

### File

```typescript
import { NgKeysPipeModule } from 'angular-pipes';
```

### Usage

```javascript
const value = {
  a: 1,
  b: 2,
  c: 3,
};
```

```markup
{{ value | keys }}
<!-- ['a', 'b', 'c'] -->
{{ [1, 2, 3] | keys }}
<!-- ['0', '1', '2'] -->
```

## toArray

Transforms an object to an array

### File

```typescript
import { NgToArrayPipeModule } from 'angular-pipes';
```

### Usage

```javascript
const value = {
  a: 1,
  b: 2,
  c: 3,
};
```

```markup
{{ value | toArray }}
<!-- [1, 2, 3] -->
```

## defaults

Apply defaults value to an object or an object in an array.

When applied to an array, the non object values will be left unchanged. The nulls and undefineds will be changed to the defaults.

### File

```typescript
import { NgDefaultsPipeModule } from 'angular-pipes';
```

### Usage

```javascript
const d = {
  a: 1,
  b: 2,
  c: 3,
};

const object = {
  a: 2,
};

const array = [{ a: 2 }, null, { b: 3 }, undefined];
```

```markup
{{ object | defaults: d }}
<!-- { a: 2, b: 2, c: 3 } -->
{{ array | defaults: d }}
<!-- [{ a: 2, b: 2, c: 3 }, { a: 1, b: 2, c: 3 }, { a: 1, b: 3, c: 3 }, { a: 1, b: 2, c: 3 }]-->
```


---

# 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://fknop.gitbook.io/angular-pipes/documentation/object.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.
