.clear()

The .clear() method deletes all values from a Set and returns undefined.

Syntax

set.clear();

No parameters are needed for the .clear() method.

Codebyte Example

Code
Output
Loading...

Contributors

Interested in helping build Docs? Read the Contribution Guide or share your thoughts in this feedback form.

Learn JavaScript on Codecademy