Array.prototype.subtract >= 0.1.0

Purpose

Get the values from the first array that are not in the second array

Syntax

Array#subtract ( ArrayarrFunctioncast_function );

Parameters

arr

The array to test agains

cast_function

Function to use to cast values

Return values

Array

New array

Examples

Return all the values of the first array that are not in the second array

var a = [0,1,2,47,99,100],
    b = [2,47,55,96,200];

a.subtract(b);
>>> [0, 1, 99, 100]

b.subtract(a);
>>> [55, 96, 200]

Remove a single value

var a = [0,1,2,47,99,100];

a.subtract(100);
>>> [0,1,2,47,99]

Comments

Ignacio

Your site has outstanding material. I bookmarked the site

Ivy

Have you ever before had troubles with your webhost? I'm open for suggestions as my webhost is terrible currently.

Darcy

Have you ever before had troubles with your webhost? I'm open for recommendations as my webhost is dreadful right now.

Deb

Your internet site has outstanding material. I bookmarked the site

Barbra

Your website has superb web content. I bookmarked the site

Aubrey

Can you tell me what platform are you utilizing on this website?