How To Create Associative Array In EcmaScript : <p>I want to create an associative array within the constructor. But  the below code throws error. Uncaught TypeError: Cannot set property 'num' of undefined</p>

<pre><code>class Validate{

    constructor(){

        this.name['num'] = ['one','two'];
    }
    display() {




        console.log(this.name['num']);
    }



}
</code></pre>
