<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@essex/toposort](./toposort.md) &gt; [array](./toposort.array.md)

## array() function

<b>Signature:</b>

```typescript
export declare function array<T = string>(nodes: ReadonlyArray<T>, edges: ReadonlyArray<[T, T | undefined]>): any[];
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  nodes | ReadonlyArray&lt;T&gt; | the nodes array |
|  edges | ReadonlyArray&lt;\[T, T \| undefined\]&gt; | the edges array |

<b>Returns:</b>

any\[\]

the topologically sorted node array

