I am a beginner of JavaScript and want to display an array of objects in HTML.
The format of the data is like this:
[
{\"key\":\"apple\",\"value\":
Iterate through the list and retrieve the data for each item this way (assuming your data is in a var called data):
for (var i = 0; i < data.length; i++) {
var id = i + 1;
var name = data[i].key;
var relevance = data[i].value;
}
Then, do something with the variables in each loop, print them out however you want.