title: Passing Object in es6 Template string
body: <p>I have this below code segment</p>
  
  <pre><code>${res.result.map(resultObj =&gt;
  `&lt;div class="col-sm-4 mb-4"&gt;
     &lt;a class="btn btn-primary" onclick="getEditable(resultObj)"&gt;Edit&lt;/a&gt;
   &lt;/div&gt;`
  )};
  
  
  window.getEditable = (resultObj) =&gt; {
    console.log(resultObj);
  }
  </code></pre>
  
  <p>This throws error "results" is not defined.
  How should I pass the results object to a function using Template String ?</p>
  
  <p>Also would like to ask is using window. is a good approach ?</p>
  
  <p>Help would be appreciated</p>