const equals = (a, b) => JSON.stringify(a) === JSON.stringify(b); const a = [1, 2, 3]; const b = [1, 2, 3]; equals(a, b); // true