title: Passing array from one js file to another js file in a serverless framework
body: <p>In One js file I'm assigning data to an object. That object has an array of objects.</p>
  
  <pre><code>const data = { 
    details: [
      {name: 'John', surname: 'Smith'},
      {name: 'Will', surname: 'Smith'},
      {name: 'Jessica', surname: 'Smith'}
    ]
  };
  </code></pre>
  
  <p>I want to call this array in the below js file. This js file will return in html format. I want to call the data.details in html and get it in html table format. When I pass the array directly in the html it works. But its doesn't work when I'm passing it as $data.details.</p>
  
  <pre><code>const PDF = data =&gt; {
    return `&lt;!doctype html&gt;
            &lt;html lang="en"&gt;
              &lt;div&gt;
                &lt;p class="note"&gt;
                  &lt;b&gt;Details:&lt;/b&gt;
                &lt;/p&gt;
                &lt;table border="1" cellpadding="0" cellspacing="0" style="font-size: 14px; width: 500px;"&gt;
                  &lt;thead&gt;
                    &lt;tr&gt;
                      &lt;th scope="col"&gt;
                        &lt;h5&gt;Name&lt;/h5&gt;
                      &lt;/th&gt;
                      &lt;th scope="col"&gt;
                        &lt;h5&gt;Surname&lt;/h5&gt;
                      &lt;/th&gt;
                    &lt;/tr&gt;
                  &lt;/thead&gt;
                  &lt;tbody&gt;
                    &lt;script language="javascript" type="text/javascript"&gt;         
                      var details = ${data.details};
                      for (var i = 0; i &lt; details.length; i++) {
                        document.write("&lt;tr&gt;&lt;td&gt;" + details[i].name + "&lt;/td&gt;");
                        document.write("&lt;td&gt;" + details[i].surname + "&lt;/td&gt;");                    
                      }
                    &lt;/script&gt;
                  &lt;/tbody&gt;
                &lt;/table&gt;
              &lt;/div&gt;
            &lt;/body&gt;
          &lt;/html&gt;`;
  };
  
  export default { PDF };
  </code></pre>
  
  <p>Please help to to get this right. Thanks.</p>