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 earth should I do this, as the following doesn't work?
The object:
({ prop_1:["1", "2"],
prop_2:["3", "4"]})
My code:
$.each(myObject, function(key,valueObj){
alert(key + "/" + valueObj.toSource() );
});
Expected output:
prop_1 / (["1", "2"])