#Array
DESCRIPTION
General
Installation
npm install eden-array
Usage
var array = require('eden-array');
Methods
clone
array clone(Array);
Clones an array
Parameters
- array
Returns
array
Example
Code
array().clone();
Outputs
RESULTS
combine
object combine(Array, Array);
Combines a list of keys and values into an object
Parameters
-
array
-
array
Returns
object
Example
Code
array().combine();
Outputs
RESULTS
concat
this concat(Array[,array..]);
Concats arrays into one
Parameters
- array[,array..]
Returns
this
Example
Code
array().concat();
Outputs
RESULTS
each
bool each(Array, Function);
Custom for each loop that handles scopes and extra arguments
Parameters
-
array
-
function
Returns
bool
Example
Code
array().each();
Outputs
RESULTS
implode
string implode(Array, Mixed, Boolis.has, Array, String);
Returns true if the array has given value
Parameters
-
array
-
mixed
-
boolis.has - = function(data, value) {Argument Testingis.argument()est(1, 'array')est(1, 'mixed');turn data.indexOf(value) !== -1;*Join array elements with a string
-
array
-
string
Returns
string
Example
Code
array().implode();
Outputs
RESULTS
isEmpty
bool isEmpty(Array);
Check if data is array @param array @return bool
Parameters
- array
Returns
bool
Example
Code
array().isEmpty();
Outputs
RESULTS
keys
array keys(Array);
Returns a list of keys
Parameters
- array
Returns
array
Example
Code
array().keys();
Outputs
RESULTS
lastIndexOf
number lastIndexOf(Array, Mixed);
Returns the last index of where in the array the value is found
Parameters
-
array
-
mixed
Returns
number
Example
Code
array().lastIndexOf();
Outputs
RESULTS
map
array map(Array, Function, [mixed[,mixed..]]);
Custom map loop that handles scopes and extra arguments
Parameters
-
array
-
function
-
[mixed[,mixed..]]
Returns
array
Example
Code
array().map();
Outputs
RESULTS
natsort
object natsort(Object);
Sorts array by natural sort
Parameters
- object
Returns
object
Example
Code
array().natsort();
Outputs
RESULTS
pop
mixed pop(Array);
Pops array from the stack
Parameters
- array
Returns
mixed
Example
Code
array().pop();
Outputs
RESULTS
push
array push(Array, Mixed[,mixed..]);
Pushes array into the stack
Parameters
-
array
-
mixed[,mixed..]
Returns
array
Example
Code
array().push();
Outputs
RESULTS
reverse
array reverse(Array);
Reverses the array
Parameters
- array
Returns
array
Example
Code
array().reverse();
Outputs
RESULTS
splice
array splice(Array, Num, Num, Mixed[,mixed..]);
Picks from chosen slice and rconturns a new array @param array @param num @param [num] @return array is.slice = function(data) { Argument Testing is.argument() est(1, 'array') est(2, 'int') est(3, 'int', 'undefined'); r args = Array.prototype.slice.apply(arguments); gs.shift(); turn data.slice.apply(data, args); * Adds/removes items to/from an array, and returns the removed item(s)
Parameters
-
array
-
num
-
num
-
mixed[,mixed..]
Returns
array
Example
Code
array().splice();
Outputs
RESULTS
sort
array sort(Array, [function]);
Sorts an array
Parameters
-
array
-
[function]
Returns
array
Example
Code
array().sort();
Outputs
RESULTS
size
number size(Array);
Returns the array size
Parameters
- array
Returns
number
Example
Code
array().size();
Outputs
RESULTS
toQuery
string toQuery(String, [string]);
Converts array to query string
Parameters
-
string
-
[string]
Returns
string
Example
Code
array().toQuery();
Outputs
RESULTS
toString
string toString();
Converts array to string
Parameters
Returns
string
Example
Code
array().toString();
Outputs
RESULTS
unshift
array unshift(Array, Mixed[,mixed..]);
Unshifts array into the stack
Parameters
-
array
-
mixed[,mixed..]
Returns
array
Example
Code
array().unshift();
Outputs
RESULTS
values
array values(Array);
Returns a list of values
Parameters
- array
Returns
array
Example
Code
array().values();
Outputs
RESULTS