4 ms·
If you want to be able to use the syntax Thing.one or Thing.two while having each refer to a discrete symbol, you should probably use Symbols so:
by pcthrowaway 2y ago
If you want to be able to use the syntax
Thing.one
or
Thing.two
while having each refer to a discrete symbol, you should probably use Symbols
so:
const Thing = {
one: Symbol(),
two: Symbol()
} as const;
will prevent anything equality matching that isn't intentional