> For the complete documentation index, see [llms.txt](https://tag.angular-package.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tag.angular-package.dev/attribute/instance/methods/toarray.md).

# toArray()

### `Attribute.prototype.toArray()`

Returns attribute primitive value converted to the `array` where the first element is the name, and the second is the value.

{% code title="attribute.class.ts" %}

```typescript
public toArray(): readonly [Name, Value] {
  return [this.#name, this.#value];
}
```

{% endcode %}

### Returns

The **return value** is the attribute of a read-only `array`.

### Example usage

```typescript
// Example usage.
import { Attribute } from '@angular-package/tag';


```
