https://github.com/web-platform-tests/wpt
Raw File
Tip revision: 345e24e70785b4c57a646f0182a6d13fba8fa076 authored by Geoffrey Sneddon on 16 March 2018, 16:55:00 UTC
Get rid of hardcoded web-platform.test in wpt/run.py
Tip revision: 345e24e
arrays.js
// Returns true if the given arrays are equal. Optionally can pass an equality function.
export function areArraysEqual(a, b, equalityFunction = (c, d) => { return c === d; }) {
  try {
    if (a.length !== b.length)
      return false;

    for (let i = 0; i < a.length; i++) {
      if (!equalityFunction(a[i], b[i]))
        return false;
    }
  } catch (ex) {
    return false;
  }

  return true;
}
back to top