title: How to Interpolate JSON Array having template variable with other JSON Object efficiently in JavaScript
body: <pre><code>template = [
    {
      records: [
        { key: &quot;Roll No&quot;, value: &quot;${student1.rollNo}&quot; },
        { key: &quot;Class&quot;, value: &quot;${student1.class} standard&quot; },
      ],
    },
      {
      records: [
        { key: &quot;Roll No&quot;, value: &quot;${student2.rollNo}&quot; },
        { key: &quot;Class&quot;, value: &quot;${student2.class} standard&quot; },
      ]
    }
  ];
  
  replacers={
     student1:{
        rollNo:100,
        class:10
     },
     student2:{
        rollNo:101,
        class:12
     }
  }
  
  </code></pre>
  <pre><code>template=[
    {
      records: [
        { key: &quot;Roll No&quot;, value: &quot;100&quot; },
        { key: &quot;Class&quot;, value: &quot;10 standard&quot; }
      ],
    },
      {
      records: [
        { key: &quot;Roll No&quot;, value: &quot;101&quot; },
        { key: &quot;Class&quot;, value: &quot;12 standard&quot; }
      ]
    }
  ];
  </code></pre>
  <p>After Interpolate / Mapping JSON array will be like above: (Without using any third party packages)</p>
  <p>template=[
  {
  title: &quot;Student 1&quot;,
  records: [
  { key: &quot;Roll No&quot;, value: &quot;100&quot; },
  { key: &quot;Class&quot;, value: &quot;10 standard&quot; }
  ],
  },
  {
  title: &quot;Student 2&quot;,
  records: [
  { key: &quot;Roll No&quot;, value: &quot;101&quot; },
  { key: &quot;Class&quot;, value: &quot;12 standard&quot; }
  ]
  }
  ];</p>