Set.prototype.clear

Removes all items from the set.

Syntax

clear()

Examples

let set = new Set()
set.add("hello")
set.clear()
set.has("hello")
false