@corefunc/corefunc
    Preparing search index...

    Function match

    • Type Parameters

      • Type

      Parameters

      • Optionalvalue: any
      • OptionalsubjectExpression: Record<string, Type> | Map<any, Type> | WeakMap<object, Type>
      • OptionaldefaultValue: unknown = undefined
      • OptionalconvertToString: boolean = false

      Returns Type

      match

      Match expression

      0.3.3

      match(String(5), { "1": "One", "3": "Three", "5": "Five" }); // ➜ "Five"
      match(5, new Map([ ["5", "Oh no!"], [5, "OK"], ])); // ➜ "OK"
      match(5, { 5: "Five" }, undefined, true); // ➜ "Five"