Skip to content

Latest commit

 

History

History
19 lines (14 loc) · 295 Bytes

File metadata and controls

19 lines (14 loc) · 295 Bytes

Array.prototype.compare

Compare 2 arrays

Regular - looking for the presence of all the elements in the array

var a = [1,4,2,2];
var b = [1,2,4];

a.compare(b); //false

Strict - compares items by position and type

var a = [1,2,4];
var b = [1,2,4];

a.compare(b,true); //true