# no-new-symbol
Disallow constructing Symbol
using new
.
Symbol
shouldn’t be constructed using new
keyword since it results in a TypeError
, instead
it should be called as a function.
# Incorrect code examples
// This call results in TypeError
const fooSymbol = new Symbol("foo");
# Correct code examples
const fooSymbol = Symbol("foo");
More incorrect examples
new Symbol()
More correct examples
Symbol()
new SomeClass()