Skip to content

Instantly share code, notes, and snippets.

@ryaan-anthony
Created February 25, 2017 10:51
Show Gist options
  • Save ryaan-anthony/68f1a52f3102ebf8626fa7b585daf6bd to your computer and use it in GitHub Desktop.
Save ryaan-anthony/68f1a52f3102ebf8626fa7b585daf6bd to your computer and use it in GitHub Desktop.
<script type="text/javascript">
class Parameters
{
constructor()
{
return new Proxy(Object.assign(this, arguments[0]), {
get: function(target, name) {
return name in target ? target[name] : undefined;
}
});
}
}
</script>
<script>
var parameters = new Parameters({test: 'success'});
console.log(parameters.test);
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment