title: Javascript | Proxy | Handler.get() method is not setting target objects properties
body: <pre><code>var target = {}
  
  var handler = {
    get (target, key) {
      console.info('get')
      return target[key]
    },
    set (target, key, value) {
      console.info('set')
      return true
    }
  }
  
  var proxy = new Proxy(target, handler)
  
  proxy.a = 'a' //prints 'set'
  console.info(proxy.a); // prints 'get'
  // &lt;- undefined
  </code></pre>
  
  <p>I was trying to understand the Javascript <code>Proxy</code> API and decided to try some code myself. I have defined an empty target to and a handler with a set and get traps. My set and get traps work perfectly fine and they're invoked everytime I set or get a property. But the last console.info statement prints an undefined. The only fix I found is to add a <code>target[key] = value;</code> just above the return statement in the set trap. But I'm pretty sure that's not correct. Can anyone help me figure out why I can't set a property using the proxy here? Thanks in Advance :)</p>