BACK
ReferenceskipLast
Reference · 100

skipLast

Skips the last N values of a finite stream.

Signature

skipLast(skipCount: number): MonoTypeOperatorFunction

What it does

Keeps a buffer of the last skipCount values. It releases a value only once it's sure it's no longer part of the tail.

When to use

Dropping final housekeeping items, removing a trailing marker, processing a stream without its last N events.

Gotcha

On a short stream it may emit nothing.

See also

takeLast, skip

script.ts // TypeScript
CONSOLE · Console output
Hit Run to see the result...