title: replace json key with another json value using node js / javascript
body: <pre><code>testDetails.map(function(data){
   
  let JsonData={
   title: data[&quot;title&quot;],
   url: data[&quot;url&quot;],
   firstName: data[&quot;username&quot;],
  
   work:[{workid:data[&quot;workid&quot;].slice(&quot;,&quot;), workname: &quot;tester&quot;}],
   employee: [{employee_id: data[&quot;employee_id&quot;].slice(&quot;,&quot;), employee_desk:&quot;custom&quot;}]
  }
  })
  </code></pre>
  <p>so my above json output look like this</p>
  <pre><code>{
   &quot;title&quot;:&quot;01&quot;
   &quot;url&quot;:&quot;employe@url.com&quot;,
   &quot;firstName&quot;:&quot;employee name&quot;,
   &quot;work&quot;:[{&quot;workid&quot;:&quot;9371&quot;, &quot;workname&quot;: &quot;tester&quot;}],
   &quot;employee&quot;:[{&quot;employee_id&quot;:&quot;weh34&quot;,employee_desk:&quot;custom&quot;}]
  }
  </code></pre>
  <p>and another JSON object where data look like this</p>
  <pre><code>let data={
    &quot;031w&quot;:&quot;ewid3728e&quot;,
    &quot;9371&quot;:&quot;emp_01&quot;,
     &quot;weh34&quot;:&quot;work_place01&quot;
  }
  </code></pre>
  <p>The workid and employee id with the JsonData I want to replace with the value which is present inside the data json so my data which is look like this</p>
  <pre><code> &quot;work&quot;:[{&quot;workid&quot;:&quot;9371&quot;, &quot;workname&quot;: &quot;tester&quot;}],
   &quot;employee&quot;:[{&quot;employee_id&quot;:&quot;weh34&quot;,employee_desk:&quot;custom&quot;}]
  </code></pre>
  <p>needed to be look like this</p>
  <pre><code> &quot;work&quot;:[{&quot;workid&quot;:&quot;work_place01&quot;, &quot;workname&quot;: &quot;tester&quot;}],
   &quot;employee&quot;:[{&quot;employee_id&quot;:&quot;emp_01&quot;,employee_desk:&quot;custom&quot;}]
  </code></pre>
  <p>I am trying to replace the code manually like this</p>
  <pre><code> work:[{workid:data.weh34, workname: &quot;tester&quot;}],
   employee: [{employee_id: data.9371, employee_desk:&quot;custom&quot;}]
  </code></pre>
  <p>but <code>data[&quot;workid&quot;].slice(&quot;,&quot;)</code> and <code>data[&quot;employee_id&quot;].slice(&quot;,&quot;)</code> always get changed so I want to match both the json and fetch the value and place it in my JsonData</p>