I am encountering an issue with a JavaScript array specifically in IE11, particularly within the for loop.
Below is the code snippet:
function onResponseReceived(responseArray) {
found = true;
var i;
for(i in responseArray) {
var item = responseArray[i];
if (item.field_number == '5') {
item.value = intlToUsDate(item.value);
console.log(item.value);
}
var inputSelector = '[name="input_' + item.field_number + '"]';
var dom_elms = document.querySelectorAll(inputSelector);
for (var e in dom_elms) {
var dom_elm = dom_elms[e];
if (dom_elm.type == 'radio' || dom_elm.type == 'checkbox') {
if (dom_elm.value == item.value && !dom_elm.checked) {
dom_elm.click();
continue;
}
} else {
dom_elm.value = item.value;
}
}
}
}
When viewing the output in IE11 using the console.log, it displays:
"
i
d
"
:
"
1
8
4
1
"
,
Comparatively, here is the output for the same JavaScript code in Chrome:
field_number
:
"5"
form_id
:
"10"
id
:
"1839"
is_synced
:
"1"
lead_id
:
"2967"
value
:
"05/08/2018"
__proto__
:
Object
It seems to process the information correctly on Chrome.
In IE11, how can I ensure that the array behaves like an object as observed in Chrome, Firefox, or Edge?
Thank you, Kevin