Skip to main content

containsKey

Checks whether a map contains an key.

containsKey(targetMap, key)

Parameters#

  • targetMap: map to search
  • key: string key to search for in targetMap

Returns#

  • Boolean indicating the result

Example#

orders = {phones: 10, bags: 20}assertTrue(containsKey(orders, 'phones'))