Methods
(static) hasIterableLength1(iterable) → {boolean}
- Source:
- Since:
- 0.1.0
Use to check if an iterable has a single element
Example
> hasIterableLength1('1')
true
> hasIterableLength1('two')
false
> hasIterableLength1([1])
true
> hasIterableLength1([1, 2])
false
> function func () {
return hasIterableLength1(arguments);
}
> func()
false
> func(1)
true
> func(1, 2)
false
Parameters:
Name | Type | Description |
---|---|---|
iterable |
iterable |
Returns:
- Type
- boolean
(static) isIterableEmpty(iterable) → {boolean}
- Source:
- Since:
- 0.1.0
Use to check if an iterable is empty
Example
> isIterableEmpty('string')
false
> isIterableEmpty('')
true
> isIterableEmpty([1, 2])
false
> isIterableEmpty([])
true
> isIterableEmpty([])
true
> function func () {
return isIterableEmpty(arguments);
}
> func()
true
> func(1, 2)
false
Parameters:
Name | Type | Description |
---|---|---|
iterable |
iterable |
Returns:
- Type
- boolean
(static) isIterableLongerThan1(iterable) → {boolean}
- Source:
- Since:
- 0.1.0
Use to check if an iterable has more than an element
Example
> isIterableLongerThan1('1')
false
> isIterableLongerThan1('two')
true
> isIterableLongerThan1([1])
false
> isIterableLongerThan1([1, 2])
true
> function func () {
return isIterableLongerThan1(arguments);
}
> func()
false
> func(1)
false
> func(1, 2)
true
Parameters:
Name | Type | Description |
---|---|---|
iterable |
iterable |
Returns:
- Type
- boolean
(static) isIterableNotEmpty(iterable) → {boolean}
- Source:
- Since:
- 0.1.0
Use to check if an iterable is not empty
Example
> isIterableNotEmpty('string')
true
> isIterableNotEmpty('')
false
> isIterableNotEmpty([1, 2])
true
> isIterableNotEmpty([])
false
> function func () {
return isIterableNotEmpty(arguments);
}
> func()
false
> func(1, 2)
true
Parameters:
Name | Type | Description |
---|---|---|
iterable |
iterable |
Returns:
- Type
- boolean