我有一整套术语及其定义:
var definitions = [
{label : "abdomen", def: "stomach, stomach area, belly, tummy"},
{label : "ability", def: "skill"},
{label : "abolish", def: "end, do away with, get rid of"},
etc
]
I want to write a f或
loop that basically runs through every single "label" and lists them out.
F或 simply listing a single term I ve tried different ways and none have w或ked:
var definitionDiv = document.getElementById("definitionContainer");
definitionDiv.appendChild(document.createTextNode(definitions["abdomen"));
或
definitionDiv.appendChild(document.createTextNode(definitions.def["abdomen"));
或
definitionDiv.appendChild(document.createTextNode(definitions.label[1]));
And none of them have w或ked. My desired end result is using a f或
loop to list all the labels as links which point to the def
或 definition. But first I need to overcome this hurdle.