Adds useful methods to the JavaScript Array type.
To use this optional module, its repository needs to be added to the application, for example by calling app.addRepository('modules/core/Array.js')
To use this optional module, its repository needs to be added to the application, for example by calling app.addRepository('modules/core/Array.js')
Methods
Return the first index position of a value
contained in an array, or -1 if it isn't contained.
parameters
Object | val | the value to check |
returns
int | the index of the first occurence of val, or -1 |
return the last index position of a value
contained in an array, or -1 if it isn't contained.
parameters
Object | val | the value to check |
returns
int | the index of the first occurence of val, or -1 |
check if an array passed as argument contains
a specific value (start from end of array)
parameters
Object | val | the value to check |
returns
boolean | true if the value is contained |
Retrieve the union set of a bunch of arrays
parameters
Array | array1 |
returns
Array | the union set |
Retrieve the intersection set of a bunch of arrays
parameters
Array | array1 |
returns
Array | the intersection set |