@svizzle/utils/array-iterable

Methods

(static) getShorter() → {iterable}

Source:
Since:
  • 0.5.0

Return the shorter iterable of the provided pair.

Example
> getShorter([[1, 2], ['b'], [1, 2, 3], ['a']])
['b']
> getShorter(['abc', 'a', [1]])
'a'
> getShorter(['bc', 'g', ''])
''
> getShorter([[3, 4], [1, 2]])
[3, 4]
> getShorter(['b', 'a'])
'b'
> getShorter([])
undefined
> getShorter('')
undefined
Parameters:
Type Description
Array.<iterable>
Returns:
Type
iterable