Skip to main content

Variable: exclude()

const exclude: {(excluded): <Value>(iterable) => Iterable<Value>; <Value>(excluded, iterable): Iterable<Value>; }

Defined in: filters.d.ts:323

Returns an iterable containing the values of iterable in iteration order excluding the values of excluded.

Call Signature

(excluded): <Value>(iterable) => Iterable<Value>

Parameters

excluded

Iterable<unknown>

Returns

<Value>(iterable): Iterable<Value>

Type Parameters

Value

Value

Parameters

iterable

Iterable<Value>

Returns

Iterable<Value>

Call Signature

<Value>(excluded, iterable): Iterable<Value>

Type Parameters

Value

Value

Parameters

excluded

Iterable<unknown>

iterable

Iterable<Value>

Returns

Iterable<Value>

Example

import { exclude, pipe, reduce, toArray } from 'lfi'

console.log(
pipe(
[`sloth`, `lazy`, `active`, `sleep`, `awake`],
exclude([`awake`, `active`]),
reduce(toArray()),
),
)
//=> [ 'sloth', 'lazy', 'sleep' ]
Playground

Since

v2.0.0