Standard built-ins

FinalizationRegistry.prototype.unregister()

Try the free JavaScript compiler

Remove registrations matching a supplied eligible token; report whether at least one was removed.

Formal Syntax & Structure

javascript syntaxjavascript
finalizationRegistry.unregister(unregisterToken)

Parameters & Attributes

NameTypeDescription
unregisterTokenObject | nonregistered SymbolToken supplied to register.

Return Value

Boolean

Whether the stated condition holds.

Working Example

Example Snippetjavascript
const r=new FinalizationRegistry(()=>{}),k={},t={};r.register(k,1,t);console.log(r.unregister(t),r.unregister(t));
JavaScript Reference