Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
  <script src="http://akdubya.github.io/dustjs/dist/dust-full-0.3.0.min.js"></script>
</head>
<body>
<div id="out"></div>
<script>
    var tpl = `{#person row=.}
                 {#columns}
                   {row[{.}]}
                   {@sep}, {/sep}
                 {/columns}<br/>
               {/person}`;
    var data = {
        "columns":["id", "name", "age"],
        "person": [
            {
                "id":1,
                "name": "Larry",
                "age": 45
            },
            {
                "id":2,
                "name": "Mike",
                "age": 23
            }
        ]
    };
    var compiled = dust.compile(tpl, "intro");
    dust.loadSource(compiled);
    dust.render("intro", data, function(err, out) {
        document.getElementById('out').innerHTML = out;
    });
</script>
</body>
</html>
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers