1 2 3 4 5 6 7 8 9 10 11 12 13 14
module.exports = function arraysEqual(a, b) { if (a === b) return true; if (a.length !== b.length) return false; for (const itemInd in a) { const item = a[itemInd]; const ind = b.indexOf(item); if (ind) { b.splice(ind, 1); } } return b.length === 0; };