How to convert JSON object to a different format : <p>I have a JSON object like this</p>

<pre><code>{
    "name": "Test Name",
    "age": 24
}
</code></pre>

<p>Is there a way I can convert this to a <strong>String</strong> in a format like</p>

<pre><code>{
    name: "Test Name",
    age: 24
}
</code></pre>

<p>The JSON will be of varying lengths with different properties.</p>

<p>Right now, I am doing this as shown below. This can get too long and messy for larger and more complex JSON objects. I need to know if there is an easier and cleaner solution for this.</p>

<pre><code>let cypherQueryObject = '{';
cypherQueryObject += ` name: "${user.name}";
if (user.age) { cypherQueryObject += `, age: "${user.age}"` };
cypherQueryObject = '}';
</code></pre>
