Как вы возвращаете отдельный li из вложенного массива в javascript?Я бы хотел, чтобы a, b, c были
<li>a</li>
<li>b</li>
вместо
<li>a,b,c,</li>
Вот что я делаю ( также на jsFiddle ):
var spellingList = ["Word1", ["a", "b", "c"], "Word2", "Word3"];
// for loop should run through spelling list array and create list items in "listSpelling"
for (var i = 0; i < spellingList.length; i++) {
// create a new li
var newLI = document.createElement("li");
var indSpellingWord = spellingList[1];
// grab the spelling list item
var newContent = document.createTextNode(indSpellingWord);
// add the spelling list item to the li
newLI.appendChild(newContent);
// get the unordered list and add the new li
var displaySpellList = document.getElementById("listSpelling");
displaySpellList.appendChild(newLI);
}
<div id="theSpellingList">
<h3>The Spelling List</h3>
<ul id="listSpelling">
</ul>
</div>