import { Meta } from '@storybook/addon-docs/blocks'

<Meta title='@dxtmisha/en/functional-basic/Functions/getMaxLengthAllArray - Maximum length in array'/>

# `getMaxLengthAllArray`

A utility that finds the longest string in the provided array and returns its length (as a number). The function uses built-in `Math.max` combined with `getLengthOfAllArray`.

**Parameters:**
- `data: ObjectOrArray<string>` — The input array of strings.

**Returns:**
`number` — The length of the longest string in the array. If an empty array is passed, it returns `-Infinity`.

```typescript
import { getMaxLengthAllArray } from '@dxtmisha/functional-basic'

const phrases = ['Hello', 'Good morning', 'Greetings']
const maxLength = getMaxLengthAllArray(phrases)

console.log(maxLength) // 12 ("Good morning")
```
