JavaScript Set.prototype.delete() Method
JavaScript Set Instance methodThis method is supported by all modern browsers.
The delete() method removes a value from a Set.
Description
The delete() method removes a value from the set and returns whether it was present. clear() removes every value.
Removing values while looping over the set is safe: values that haven't been visited yet and are removed are simply skipped. To remove every value at once, call clear().
Values are compared with the SameValueZero algorithm, so NaN matches NaN, but two separate objects with the same contents are different values.
Syntax
set.delete(value)Parameters
- valueThe value to remove.
Return Value
true if the value was removed, false if it wasn't there.
Example
Browser Support
The following information will show you the current browser support for the Set.prototype.delete() method. Hover over a browser icon to see the version that first introduced support for this method.
This method is supported by all modern browsers.
Desktop





Tablets & Mobile






-
Supported Unknown Not supported
Sponsors
Password Manager
PasswordPal stores your passwords and private notes behind encryption that happens in your browser.
Copy Paste List
Copy and paste or download lists in your preferred format, including plain text, PDF, or HTML.
Unicode Characters & Emojis
Search all Unicode characters and emojis plus other tools.
Check Shortened URLs
Expand shortened URLs to view the destination link.
Advertise Here
Advertise your company and products here!