var obj = new Proxy(
{foo_: "bar"},
{get: function(target, name) {
return target[name + "_"];
});
console.log(obj.foo); //logs "bar"
Of course maybe you'd do something a little fancier than just return the value, like return null for property names with _ to prevent accessing private variables. I don't know what the performance of Proxy will be like, but it's an alternative to getters and setters and lets you have a fall through for things you haven't defined.What I'm really excited about is reactivity on objects for setting and getting without using functions. You could have your setter trigger events without forcing someone to use a set function like you have in Backbone.
I think we'll see an entirely new set of model libraries because of these new ECMAScript 5 and 6 features.