I am trying to loop through the below shown JS object with the following code snippet, while needing to fetch both the index key as well as the inner object.
How on ear
You could use a for in loop:
var myObject = ({ prop_1:["1", "2"], prop_2:["3", "4"]}) for (var key in myObject) { if (myObject.hasOwnProperty(key)) { alert(key + "/" + myObject[key]); } }