Skip to main content

arrayRemoveItem

Removes provided element from an array.

Parameters

  • array array of strings | numbers to remove element from
  • toRemove (string | number) to remove from the array

Examples

arrayRemoveItem(['The', 'quick', 'brown'], 'The');
// => ['quick', 'brown']

arrayRemoveItem([2, 4, 1], 4);
// => [2, 1]

Returns array without the removed element.

Meta

  • version: 4.0.8