0

There is a json array in my html passed from Flask. But when I try to use javascript to loop through it, it seems like I can only get the subscript of array. The results display as 0,1,2... kind of thing. How can I get the value of json array instead of the subscript?

Json Array:

json_array = ["EPGD", "KEGG"]

Javascript code:

for (var item in json_array){
    alert(item);
}
Coding_Rabbit
  • 1,287
  • 3
  • 22
  • 44

0 Answers0