.clear()

BrandonDusch's avatar
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

Contribute to Docs

Learn JavaScript on Codecademy