I am trying to return all the table_name
fields in my javascript JSON object:
{
"Products": {
"Antifreeze": {
"table_name":"old_world",
"tableFields":
[
["product_code", "Product Code"],
["brand", "Brand"],
["category", "Category"],
["subcategory", "Subcategory"],
["description", "Description"],
["service_interval", "Service Interval"],
["concentration", "Concentration"],
["size", "Size"],
["price", "Price"]
]
},
"Lubricants and Greases": {
"table_name":"lubricants_grease",
"tableFields":
[
["product_code", "Product Code"],
["brand", "Brand"],
["category", "Category"],
["description", "Description"],
["price", "Price"]
]
}
}
}
So far I tried:
for(var key in Products) {
console.log(Products.table_name);
};
But this returns undefined... can someone help?
Thanks in advance!