arraysEqual function

dynamic arraysEqual(
  1. dynamic ar1,
  2. dynamic ar2
)

Implementation

function arraysEqual(ar1, ar2) {
    const n = ar1.length;
    if (n !== ar2.length) { return false; }
    for (let i = 0; i < n; i++) {
        if (ar1[i] !== ar2[i]) { return false; }
    }
    return true;
}