Using variables

How to run script and variables. Or not to, as it doesn't actually work.

<div id="output">
    #{ var counter = 0; }#
    <ul>
    #for(let item of items) {#
        <li>#counter#. #item#</li>
    #{ counter++; }#
    #}#
    </ul>
</div>

<script src="https://cdn.jsdelivr.net/gh/richdafunk/hashJS@v1.3.1/hashJS.js"></script> 
<script>
    const data = {
        items: ['Item 1', 'Item 2', 'Item 3']
    };

    var h = new hashJS("output");
    h.bind(data);
</script>
Output result:
#{ var counter = 0; }#
    #for(let item of items) {#
  • #counter#. #item#
  • #{ counter++; }# #}#