title: Fabric.js - Unable to set properties dynamically
body: <p>I am trying to set the <code>direction</code> dynamically but something is not working. I do not get an error. </p>
  
  <pre><code>function moveSelection(keyPressed) {
      var group = canvas.getActiveGroup(),
      obj = canvas.getActiveObject();
  
      if(!group &amp;&amp; !obj) {return;}
  
      var direction = '',
          sign = '',
          operators = {
              '+': function(a, b) { return a + b },
              '-': function(a, b) { return a - b },
          };
      switch(keyPressed) {
          case 37:
              direction = 'left';
              sign = '-';
          break;
          case 38:
              direction = 'top';
              sign = '-';
          break;
          case 39:
              direction = 'right';
              sign = '+';
          break;
          case 40:
              direction = 'bottom';
              sign = '+';
          break;
      }
  
      if(group){
          group.set({
              direction : operators[sign](group.get(direction), 1)
          });
          canvas.renderAll();
      } else {
        obj.set({
          direction : operators[sign]( obj.get(direction),1 )
        });
        canvas.renderAll();
      }
  }
  </code></pre>
  
  <p>But when i change the code to the following then it works fine.. What is wrong? Thank you:</p>
  
  <pre><code>obj.set({
      'left' : operators[sign]( obj.get(direction),1 )
  });
  </code></pre>