removeFrom
Removes an item from list using item or an entry from map using key
removeFrom(targetList, item)
# Or
removeFrom(targetMap, key)Parameters#
targetList: The targetlistitem: Alistitem to remove fromtargetListtargetMap: The targetmapkey:stringkey to remove it's entry fromtargetMap
Returns#
- A boolean indicating the removal. A
falsewill be returned if anitemorkeywasn't found intargetListortargetMap
Example#
# Remove an item from listfruits = ['apple', 'banana', 'orange']removeFrom(fruits, 'apple')print(fruits) # prints [banana, orange]
# Remove by key from mapproduct = { name: 'iPhone', model: '8', price: 600}removeFrom(product, 'model')print(product) # prints {name: iPhone, price: 600}