.clear()

Published Jun 16, 2022
Contribute to Docs

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

us
Visit us
code
Hide code
Code
Output
Hide output
Hide output
Loading...

All contributors

Looking to contribute?

Learn JavaScript on Codecademy