I want to iterate through this array so I can print all the topic_name
within the array.
a = [
{
"topic_name": "abc",
"rdf_id": "pyt1.1",
"ex_name": "hello_world",
"line_number": "1",
"code": "some code",
"comment": "some comment"
},
{
"topic_name": "abc",
"rdf_id": "pyt1.2",
"ex_name": "hello_world",
"line_number": "2",
"code": "some code",
"comment": "some comment"
},
]
i have tried the following...but no help
for(var i = 0; i < a.length; i++) {
var item_name = a[i];
var arr = item_name.topic_name;
console.log(arr);
}