Using variables in object property names
<p>I have a variable called direction that stores either: <code>left</code>, <code>right</code>.</p>

<p>I need to change the affected margin based on that variable.</p>

<p>Right now I'm using conditions, is it possible to replace "left" with the output of the variable <code>direction</code>?</p>

<pre><code>$("#map").animate({"margin-left": "+=50px"}, 500);
</code></pre>
