## diffArrays() function  
Calculate the shortest sequence of operations to get from `input` to `output`, using a dynamic programming implementation of the Levenshtein distance algorithm.

To get from the input ABC to the output AZ we could just delete all the input and say "insert A, insert Z" and be done with it. That's what we do if the input is empty. But we can be smarter.

output A Z - - [0] 1 2 input A | 1 [0] 1 B | 2 [1] 1 C | 3 2 [2]

1. start at 0,0 (+0)  
2) keep A (+0)  
3) remove B (+1)  
4) replace C with Z (+1)

If the `input` (source) is empty, they'll all be in the top row, resulting in an array of 'add' operations. If the `output` (target) is empty, everything will be in the left column, resulting in an array of 'remove' operations.

**Signature:**
```typescript
export declare function diffArrays<T>(input: T[], output: T[], ptr: Pointer, diff?: Diff): Operation[];
```

## Parameters  
| Parameter | Type | Description |  
| --- | --- | --- |  
| input | T[] | The original array. |  
| output | T[] | The target array. |  
| ptr | [Pointer](/content/docs/sdk/core.pointer) | JSON Pointer. |  
| diff | [Diff](/content/docs/sdk/core.diff) | _(Optional)_ Diff function. |

**Returns:**  
[Operation](/content/docs/sdk/core.operation)  
A list of add/remove/replace operations.

- [diffArrays() function](/content/docs/sdk/core.diffarrays#diffarrays-function/index.html)  
- [Parameters](/content/docs/sdk/core.diffarrays#parameters/index.html)
