<body>
<% var a = ["1","2","3","4"]
<% var i = 0 %>
<script>
var n = "<% a.length %>"
for(var i=0;i<n;i++){
console.log("<%= a[i] %>")
}
</script>
</body>
In the above code I want that the "i" of a[i] should get incremented after each iteration.For this I have to change the ejs "i" to the javascript variable and then increment it.Is there any way to increment the ejs "i" under javascript tag????Or any other method for getting the above result??