If you only need a flat array (i.e. not multidimensional and without arrays inside the array), you can do the following in simple JavaScript:
var strs = [ "String 1", "String 2", "String 3" ];
var list = document.createElement("ul");
for (var i in strs) {
var anchor = document.createElement("a");
anchor.href = "#";
anchor.innerText = strs[i];
var elem = document.createElement("li");
elem.appendChild(anchor);
list.appendChild(elem);
}
Then add listto any parent element in the body that you desire.
source
share