My iteration over the JSON object doesn't work as expected. What's wrong?
function handleResponse(e) {
var jsonObj = JSON.parse(e.postData.contents);
console.log("Note=" + jsonObj['Note'] + ", Market=" + jsonObj['Market']);
// --> "Note=blabla, Market=flowerMarket"
for (var [key,val] in jsonObj) {
console.log("Key="+key);
console.log("Value="+val);
}
// --> "Key=N" "Value=o" "Key=M" "Value=a"
}
The log shows my loop takes only the first letter of the value as whole value and the second letter of the value as key. How do I get the whole key value pairs !?