eta-dev / eta

Embedded JS template engine for Node, Deno, and the browser. Lighweight, fast, and pluggable. Written in TypeScript
https://eta.js.org
MIT License
1.35k stars 60 forks source link

Is it possible to turn the below code to a one line #251

Closed Sulaimon-Abiola closed 11 months ago

Sulaimon-Abiola commented 11 months ago

Is it possible to turn the below code to a one line

<% let getProduct = await products(3) %>

<% getProduct.forEach(function(product) { %>

  • <%= product %>
  • <% }) %>

    nebrelbug commented 11 months ago

    Sure is! Here's a potential example:

    - <%= (await products(3)).join("\n- ") %>