.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

Code
Output
Loading...

All contributors

Looking to contribute?

Learn JavaScript on Codecademy