Standard built-ins

Set.prototype.delete()

Try the free JavaScript compiler

Remove a member; report whether it existed.

Formal Syntax & Structure

javascript syntaxjavascript
set.delete(value)

Parameters & Attributes

NameTypeDescription
valueAnyValue to associate or insert.

Return Value

Boolean

Whether the stated condition holds.

Working Example

Example Snippetjavascript
const s=new Set([1]);console.log(s.delete(1),s.delete(1));
JavaScript Reference