const secretKey = Symbol('key');
const secretValue = 'value';
function Store() {
this[secretKey] = secretValue;
}
Store.prototype.get = function(key) {
return this[key];
};
const store = new Store();
const revealed = store.get(secretKey);
console.log(revealed);Ответ: 'value'
JavaScript test | #JavaScript