Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

more functionality for the array class

branch: master

Fetching latest commit…


Cannot retrieve the latest commit at this time

Octocat-spinner-32 Source
Octocat-spinner-32 .gitignore
Octocat-spinner-32 package.yml

Additional Functions for the Array class

Provides additional functions on arrays. Currently available functions are:

intersect(array): creates an intersection of the current array and the given one.

differentiate(array): returns the symmetric difference between this array and the given one.

getRange(int, int): Returns the given number of elements from the array starting at the given index. If the second parameter is not defined, all elements until the end of the array will be returned.

reverse(): Reverses the elements within the array and returns as an array.

How to use

Simply include the javascript file after including MooTools core.

Then use them:

var a = [1, 2, 3, 4, 5];
var b = [4, 5, 6, 7, 8];

// returns [4, 5]

// returns [1, 2, 3, 6, 7, 8]

a.getRange(2, 3);
// returns [3, 4, 5]

// returns [4, 5]

// return [5, 4, 3, 2, 1]
Something went wrong with that request. Please try again.