Quick overview
Array.last()
[1,2,3,4,5].last() // => 5
[1,2,3,4,5].last(2) // => 5,4
Array.first()
[1,2,3,4,5].first() // => 1
[1,2,3,4,5].first(3) // => 1,2,3
Array.size()
[1,2,3,4,5].size() // => 4
Array.filter(condition())
[1,2,3,4,5].filter(function(index) {
return index > 3;
}) // => [4,5]
Array.reverse()
[1,2,3,4,5].reverse() // => [5,4,3,2,1]
Array.contains()
[1,2,3,4,5].contains(4) // => [1,2,3,4,5]
[1,2,3,4,5].contains('a test string') // => false
Array.copy()
var x = [1,2,3,4,5],
y = x.copy()
// => x = [1,2,3,4,5]
// => y = [1,2,3,4,5]
Array.merge()
[1,2,3,4,5].merge(['another', 'array']) // => [1,2,3,4,5,'another','array']
Array.each()
[1,2,3,4,5].each(function(item) { console.log(item * 5); }); // => 5,10,15,20,25
Array.prepend()
['Array', 'is', 'awesome'].prepend('My') // => ['My', 'Array', 'is', 'awesome'];
Array.append()
[1,2].append('wrapper for Array.push()') // => [1,2,'wrapper for Array.push()']
Array.concat()
[1,2].concat([3,4,5,6], 'Some', 'Strings'); // => [1,2,3,4,5,6,'Some','String']