README
Arrayer
Some handy array-related functions.
Functions
- equal(arr1, arr2) ⇒
boolean
Compare two arrays and check if they are the same.
- arrange(...arrays) ⇒
Array.<any>
Arrange various arrays into a single one.
- remove(item, arr) ⇒
Array.<any>
Removes the first match of the specified item.
- removeAll(item, arr) ⇒
Array.<any>
Removes all matches of the specified item.
- longestString(arr) ⇒
Object
Get the longest string of an array.
- highestNumber(arr) ⇒
number
Get the highest value of a numeric array.
boolean
equal(arr1, arr2) ⇒ Compare two arrays and check if they are the same.
Kind: global function
Returns: boolean
- Whether they are the same or not.
Author: ThePhoDit
Param | Type | Description |
---|---|---|
arr1 | Array.<any> |
First array. |
arr2 | Array.<any> |
Second array. |
Array.<any>
arrange(...arrays) ⇒ Arrange various arrays into a single one.
Kind: global function
Returns: Array.<any>
- Array with all values.
Author: ThePhoDit
Param | Type | Description |
---|---|---|
...arrays | Array.<any> |
All arrays to arrange. |
Array.<any>
remove(item, arr) ⇒ Removes the first match of the specified item.
Kind: global function
Returns: Array.<any>
- Array without the removed item.
Author: ThePhoDit
Param | Type | Description |
---|---|---|
item | string | number | boolean |
The item to remove. |
arr | Array.<(string|number|boolean)> |
The array from where the item is removed. |
Array.<any>
removeAll(item, arr) ⇒ Removes all matches of the specified item.
Kind: global function
Returns: Array.<any>
- Array without the removed items.
Author: ThePhoDit
Param | Type | Description |
---|---|---|
item | string | number | boolean |
The item to remove. |
arr | Array.<(string|number|boolean)> |
The array from where the item is removed. |
Object
longestString(arr) ⇒ Get the longest string of an array.
Kind: global function
Returns: Object
- The word and the length of it.
Author: ThePhoDit
Param | Type | Description |
---|---|---|
arr | Array.<string> |
Array with different words. |
number
highestNumber(arr) ⇒ Get the highest value of a numeric array.
Kind: global function
Returns: number
- The highest number.
Author: ThePhoDit
Param | Type | Description |
---|---|---|
arr | Array.<number> |
Array with different numbers. |