Question #178

Author: admin
tags: JavaScript  
const s = Symbol();

const obj = {
  a: 10,
  [s]: 7,
};

const objDeepCopy = structuredClone(obj);

console.log(objDeepCopy); // ??
What will be printed?
{a: 10, Symbol(): 7}
{a: 10, s: 7}
{a: 10}
Nothing, DataCloneError will be thrown
The structured clone algorithm skips values of the symbol type.
Rate the difficulty of the question:
easyhard