Using dot notation with variable to get object value in javascript : <p>I have a config object like this</p>

<pre><code>{ config: {
    params: {
        football: {
            url: ''
        },
        soccer: {
            url: ''
        }
    }
}
</code></pre>

<p>I simply need to get at the <code>football</code> or <code>soccer</code> url value using a variable, so something like </p>

<pre><code>let sport = 'soccer';

let path = config.params.`sport`.url;
</code></pre>

<p>I've tried bracket notation like <code>config.params[sport]</code> and the <code>eval</code> function but neither seem to do the trick.  I'm sure I'm misnaming what I'm trying to do which is likely why I can't seem to find an answer.</p>

<p>thanks</p>
