How to use variables in dot notation like square bracket notation
<p>I have been using square bracket notation in Javascript to create and call associative arrays.</p>

<p>In this example, I understand that square bracket notation allows you to use a variable to call a certain object in the array.</p>

<p>How would you do something like this in dot notation?</p>

<pre><code>var item = {};
    item['1'] = 'pen';

var x = 1;

console.log(item[x]);  // console will show 'pen'
</code></pre>
