doesNotContain helper function

It would be handy if a function similar to the following is present alongside contains().

/**
 * Check if an array does not contain a value.
 * @param array - The array to check
 * @param value - The value to check for
 * @returns true if the array does not contain the value, true otherwise
 */
export const doesNotContain = (array: Array<any>, value: any) =>
  !array.includes(value);

Please authenticate to join the conversation.

Upvoters
Status

Canceled

Board

Feature

Tags

Low Priority

Date

About 1 year ago

Author

Sridhar Katakam

Subscribe to post

Get notified by email when there are changes.