string-arrays-equal
v0.2.5
Published
Lightweight test to see if two arrays of strings are equal, ignoring order.
Downloads
9
Readme
string-arrays-equal
Lightweight, simple test to see if two arrays of strings are equal, ignoring order.
Usage
To add to your project, run npm install --save string-arrays-equal
.
var stringArraysEqual = require('string-arrays-equal');
var arrayA = ['a', 'b', 'c', 'd'];
var arrayB = ['d', 'c', 'b', 'a'];
var arrayC = ['a', 'b', 'c', 'e'];
console.log('arrayA and arrayB', stringArraysEqual(arrayA, arrayB));
// arrayA and arrayB, true
console.log('arrayA and arrayC', stringArraysEqual(arrayA, arrayC));
// arrayA and arrayC, false