Skip to main content

containsElement

Checks whether a list contains an item.

containsElement(targetList, item)

Parameters#

  • targetList: list to search
  • item: To search for in targetList

Returns#

  • Boolean indicating the result

Example#

fruits = ['mango', 'plum']assertFalse(containsElement(fruits, 'apple'))