Best and Efficient way of creating C++ struct like things in JS
<p>I have one JSON data which I have written in my JS code as</p>

<pre><code>let CreateIssueFormData = (function() {
    return {
        "fields": {
            "project": {
                "key": "NC"
            },

            "issuetype": {
                "id": ""
            },

            "components": [{
                "id": ""
            }],

            "summary": "",

            "description": "",

            "labels": [],

            "timetracking": {
                "originalEstimate": "1w",
                "remainingEstimate": "5d"
            }

        }
    }
});
</code></pre>

<p>and I'm using it as </p>

<pre><code>let formData = new CreateIssueFormData();
formData.fields.issuetype.id = reqParams.issuetype;
formData.fields.components[0].id = reqParams.component;
formData.fields.summary = reqParams.summary;
formData.fields.description = reqParams.description;
</code></pre>

<p>I've first created the class like data-structure so that whenever I need it I will instantiate a object and give that instance it's values.</p>

<p>Also declaring the struct like give a sense of what should be there in my object.</p>

<p><strong>QUESTION:</strong></p>

<ol>
<li>Is it a good way to do in javascript?</li>
<li>Any other efficient way for  doing this?</li>
</ol>

<p>I've started JS few months back and earlier I was coding in C++. </p>