What would be the output of using the spread operator on an object with symbol properties?

  • It will throw an error because the spread operator cannot be used with objects containing symbol properties.
  • It will copy all properties except the symbol properties.
  • It will include the symbol properties in the spread.
  • It will create an empty object.
When using the spread operator on an object with symbol properties, it will copy all properties except the symbol properties. Symbols are not enumerable by default, so they are excluded when spreading an object.
Add your answer
Loading...

Leave a comment

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