Skip to content

Instantly share code, notes, and snippets.

@amasad
Forked from petermichaux/adam.js
Last active December 10, 2015 12:08
Show Gist options
  • Save amasad/4432028 to your computer and use it in GitHub Desktop.
Save amasad/4432028 to your computer and use it in GitHub Desktop.
var adam = Proxy.create({
get: function (rec, message) {
var firstname = "Adam";
var lastname = "of Eden";
switch (message) {
case "getName":
return firstname + " " + lastname;
default:
throw "unknown message " + message;
}
}
});
adam.getName; // "Adam of Eden"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment