jty
    Preparing search index...

    Function isEqualMap

    • Checks if two Map objects are the same.

      Type Parameters

      • T
      • U

      Parameters

      • x: unknown

        The first value to compare.

      • ref: Map<T, U>

        The reference Map.

      Returns x is Map<T, U>

      true if the maps are the same, false otherwise.

      if ref is not a Map.

      isEqualMap(new Map([['a', 1]]), new Map([['a', 1]])) => true
      isEqualMap(new Map([['a', 1]]), new Map([['a', 2]])) => false
      isEqualMap(new Map([['a', 1]]), new Map([['b', 1]])) => false
      isEqualMap(new Map(), new Map()) => true