Using ES6's Proxy for safe Object property access
Gidi Meir Morris
2564

This is cool but a bit complicated no? I really like your deepAccess function. It would be awesome if we could make it as natural as possible. This felt more natural to me:

```

Object.prototype.safe = function(dotpath) {
 var obj = this;
 return dotpath.split(‘.’).reduce((obj, key) => {
 if(obj && key in obj) {
 return obj[key];
 }
 return undefined;
 }, obj);
}

```

Usage:

```

var a = {b:{}};

a.safe(‘b.c’);

```

I’m trying to get it as close to `a.b.c` as possible. There probably should be a way with getters no?