javascript: Access object properties through variable
<p>I want to access a Javascript Object dynamicly.</p>

<p>Example:</p>

<pre><code>example: { 
    name: "dev.pus", 
    year: 2012, 
    os: "linux" 
}
</code></pre>

<p>This isn't anything new. Now you normaly can access properties of the "example" with:</p>

<pre><code>console.log(example.name);
// or
console.log(example.year);
</code></pre>

<p>But what is if I want to take the attribute dynamicly?
For example, another var (lets assume the user sets it) should decide which property we want:</p>

<pre><code>var = "name";
console.log(example.var); // error
console.log(example[var]); // error
</code></pre>

<p>What is the way to go?</p>
