Arrays in Javascript

A quick reference to JS-arrays.

Create array
var my_rray = ["foo", "bar"];
var my_rray = new Array("foo", "bar");
var my_rray = new Array();
var my_rray = my_string.split(",");
var my_rray = my_string.match("RegExp");
var my_rray = array1.concat(array2 [, ...]);
var my_rray = array1.slice(start [, end]);
Check array
var x = Array.isArray(my_rray);
var x = my_rray.length;
Get item value
var x = my_rray[0];
var x = my_rray[my_rray.length - 1];
Get index value
var x = my_rray.indexOf("bar" [, start]);
var x = my_rray.findIndex(function("bar" [, index [, array]]) [, thisValue]);
var x = my_rray.lastIndexOf("bar" [, start]);
Loop/search
my_rray.every(function("bar" [, index [, array]]) [, thisValue]);
my_rray.forEach(function("bar" [, index [, array]]) [, thisValue]);
my_rray.filter(function("bar" [, index [, array]]) [, thisValue]);
my_rray.find(function("bar" [, index [, array]]) [, thisValue]);
my_rray.map(function("bar" [, index [, array]]) [, thisValue]);
my_rray.reduce(function(total, currentValue [, currentIndex [, array]]) [, initialValue]);
my_rray.reduceRight(function(total, currentValue [, currentIndex [, array]]) [, initialValue]);
Array to string
var x = my_rray.join(",");
var x = my_rray.toString();
var x = my_rray.valueOf();
Operations
my_rray.copyWithin(target, start [, end]);
my_rray.fill(value [, start [, end]]);
my_rray.reverse();
my_rray.sort([function(){}]);
Add to first place
var x = my_rray.unshift("foo" [, ...]);
Add to last place
var x = my_rray.push("bar" [, ...]);
Remove first element(s)
var x = my_rray.shift();
Remove last element(s)
var x = my_rray.pop();
Remove by index value (or add)
var x = my_rray.splice(index , number [, item1 [, ...]]);