Filters out the given value.

Type signature

(y: any) => (xs: any[]) => any[]

Examples

except(2)([1, 2, 3, 4, 5]);
// ⇒ [1, 3, 4, 5]
Try in REPL
except(2)([1, 2, 2, 4, 2]);
// ⇒ [1, 4]
Try in REPL

Questions

  • How to get all the values of an array except the given one?

TypeScript sourceJavaScript source