Q. Which one of the following is the correct output for the given JavaScript code?
Code: const object1 ={};
a = Symbol('a');
b =Symbol.for('b');
object1[a]='harry';
object1[b]='derry';
constobjectSymbols=Object.getOwnPropertySymbols(object1);
console.log(objectSymbols.length);
β
Correct Answer: (C)
2