var a = [];
a[5] = 5;
a[0] = 0;
a['z'] = '70';
a[3] = 3;
a[2] = 2;
a['8'] = '8';
a[1] = 1;
a[4] = 4;
print('foreach loop');
for (var i in a) {
print(a[i]);
}
print('foreach function');
a.forEach(function(x) {
print(x)
});
dmFyIGEgPSBbXTsKCmFbNV0gPSA1OwphWzBdID0gMDsKYVsneiddID0gJzcwJzsKYVszXSA9IDM7CmFbMl0gPSAyOwphWyc4J10gPSAnOCc7CmFbMV0gPSAxOwphWzRdID0gNDsKCnByaW50KCdmb3JlYWNoIGxvb3AnKTsKZm9yICh2YXIgaSBpbiBhKSB7CglwcmludChhW2ldKTsKfQpwcmludCgnZm9yZWFjaCBmdW5jdGlvbicpOwphLmZvckVhY2goZnVuY3Rpb24oeCkgewoJcHJpbnQoeCkKfSk7