UNPKG

330 BTypeScriptView Raw
1/**
2 * Compare two arrays with primitive values as the content.
3 * We need to make sure that both values and order match.
4 */
5export default function isArrayEqual(a: any[], b: any[]) {
6 if (a === b) {
7 return true;
8 }
9
10 if (a.length !== b.length) {
11 return false;
12 }
13
14 return a.every((it, index) => it === b[index]);
15}