equals
static
boolean
equals
(
first_Array
,
second_Array
)
Checks if two Arrays have same content per position using the
Note that it returns
==
operator.Note that it returns
false
even if at least one parameter isn't an Array Object.
- Parameters:
-
first_Array <Object>
-
second_Array <Object>
- Returns:
boolean
- true if both arguments have same content at same position
forEach
static
void
forEach
(
an_Array
,
callback
,
[args]
)
Calls {@param}
An optional third argument can be passed as argument of {@param}
callback
on each element of given Array.An optional third argument can be passed as argument of {@param}
callback
.
Note that it breaks execution if a callback returns false
. If {@param} an_Array
isn't an Array Object this function does nothing exiting silently.
- Parameters:
-
an_Array <Object>
-
callback <Function>
an (eventually) anonymous function fired on each element -
[args] <Object>
optional argument for callback. May be everything.
- Returns:
void
frequency
static
Integer
frequency
(
an_Array
,
object_to_find
)
Counts how many times {@param}
Note that it returns {Integer} 0 even if {@param}
object_to_find
appears in {@param} an_Array
.Note that it returns {Integer} 0 even if {@param}
an_Array
isn't an Array Object.
- Parameters:
-
an_Array <Object>
-
object_to_find <Object>
- Returns:
Integer
- counts occurences in an Array
indexOf
static
Integer
indexOf
(
an_Array
,
object_to_find
)
Returns the index (position) of the first occurence of {@param}
Note that it returns -1 even if {@param}
object_to_find
inside {@param} an_Array
using the ==
operator, -1
otherwise.Note that it returns -1 even if {@param}
an_Array
isn't an Array Object.
- Parameters:
-
an_Array <Object>
-
object_to_find <Object>
- Returns:
Integer
- the position
isArray
static
boolean
isArray
(
may_be_everything
)
Checks if provided parameter is an Array
- Parameters:
-
may_be_everything <Object>
- Returns:
boolean
- true if parameter is an Array
lastIndexOf
static
Integer
lastIndexOf
(
an_Array
,
object_to_find
)
Returns the index (position) of the last occurence of {@param}
Note that it returns -1 even if {@param}
object_to_find
inside {@param} an_Array
using operator ==
, -1
otherwise.Note that it returns -1 even if {@param}
an_Array
isn't an Array Object.
- Parameters:
-
an_Array <Object>
-
object_to_find <Object>
- Returns:
Integer
- the position
max
static
Object
max
(
an_Array
)
Compares elements each other using operator
Note that it returns
>
of given Array returning the highest value.Note that it returns
null
even if {@param} an_Array
isn't an Array Object.
- Parameters:
-
an_Array <Object>
- Returns:
Object
- the highest value
min
static
Object
min
(
an_Array
)
Compares elements each other using operator
Note that it returns
<
of given Array returning the lowest value.Note that it returns
null
even if {@param} an_Array
isn't an Array Object.
- Parameters:
-
an_Array <Object>
- Returns:
Object
- the lowest value
parse
static
Array
parse
(
str
)
Parses string {@param}
Internally this method parses the string via a JSON format, so it fails when native JSON parsing fails.
str
in the form [element list separated by commas]
.Internally this method parses the string via a JSON format, so it fails when native JSON parsing fails.
- Parameters:
-
str <String>
- Returns:
Array
remove
static
Array
remove
(
an_Array
,
value
)
Creates a copy of {@param}
{@param}
an_Array
without {@param} value
.{@param}
value
matches using !=
operator.
If {@param} an_Array
isn't an Array Object it returns the parameter itself.
- Parameters:
-
an_Array <Object>
-
value <Object>
the element to remove
- Returns:
Array