Which of the following statements is true regarding JavaScript's symbol data type?

  • Symbols can be used as property keys in objects, but they are not unique.
  • Symbols are always visible in the global scope.
  • Symbols are automatically garbage collected.
  • Symbols are of the same data type as strings.
Symbols in JavaScript can be used as property keys in objects, and they are guaranteed to be unique. This uniqueness makes them useful for defining non-colliding property names.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *