frozenSet
Creates a frozen Set
object.
- Use the
new Set()
constructor to create a newSet
object fromiterable
. - Set the
add
,delete
andclear
methods of the newly created object toundefined
, so that they cannot be used, practically freezing the object.