j.ArraysAreEqual

PHOTO EMBED

Wed Sep 22 2021 13:45:20 GMT+0000 (UTC)

Saved by @rick_m #javascript

function arraysAreEqual(a, b) {
    return Array.isArray(a) &&
        Array.isArray(b) &&
        a.length === b.length &&
        a.every((val, index) => val === b[index]);
}
content_copyCOPY

https://flexiple.com/javascript-array-equality/