eta-dev / eta

Embedded JS template engine for Node, Deno, and the browser. Lighweight, fast, and pluggable. Written in TypeScript

Home Page:https://eta.js.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

Sulaimon-Abiola opened this issue · comments

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

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

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

  • <%= product %>

  • <% }) %>

    Sure is! Here's a potential example:

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