Answers for "js array equals ignore order"

0

js array equals ignore order

equalsIgnoreOrder(a, b) {
      for (const v of new Set([...a, ...b]))
        if (a.filter((e) => e === v).length !== b.filter((e) => e === v).length)
          return false;
      return true;
    },
Posted by: Guest on September-28-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language