Skip to content

Instantly share code, notes, and snippets.

@jasuperior
Created January 23, 2018 14:40
Show Gist options
  • Save jasuperior/138866567091e18705c2a27244fbdf02 to your computer and use it in GitHub Desktop.
Save jasuperior/138866567091e18705c2a27244fbdf02 to your computer and use it in GitHub Desktop.
aSymboler - A common interface for using symbol property values to create private keys.
const s = new Proxy({},{
get(target, prop){
if(!target[prop]) target[prop] = Symbol();
return target[prop];
},
set(){
return false;
}
})
var x = {};
x[s.a] = 6
console.log(x[s.a]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment