Symbols are a new type of primitive value in JavaScript and are used to
create nonenumerable properties that can’t be accessed without
referencing the symbol.
While not truly private, these properties are harder to accidentally change
or overwrite and are therefore suitable for functionality that needs a level
of protection from developers.
You can provide descriptions for symbols that allow for easier
identi†cation of symbol values. There is a global symbol registry that
allows you to use shared symbols in di†erent parts of code by using the
same description. In this way, the same symbol can be used for the same
reason in multiple places.
Methods like Object.keys() or Object.getOwnPropertyNames() don’t return
symbols, so a new method called Object.getOwnPropertySymbols() was added
in ECMAScript 6 to allow retrieval of symbol properties. You can still make
changes to symbol properties by calling the Object.de†neProperty() and
Object.de†neProperties() methods.
Well-known symbols de†ne previously internal-only functionality for
standard objects and use globally-available symbol constants, such as the
Symbol.hasInstance property. These symbols use the pre†x Symbol. in the
speci†cation and allow developers to modify standard object behavior in
a variety of ways.
удалено. форумка за необоснованную критику действий Ордена Стражей вне специального раздела