简体   繁体   中英

Can't iterate over array in certain pages

I have this simple array:

var a = new Array();
a.push(o);

When running this code:

a.forEach(function(o){console.log(o)});

In a blank page - I can see the object being logged to the console.

The thing is - I have this code running in a another page and The foreach loop does not log anything, even though I can see the object in a[0].

I suspect this may has to do with the Prototype JS lib that this page utilizes- though I wasn't able to prove it.

Does that sound familiar?

Thanks.

The prototype replaces console log messages, use this code to see the actual console log:

delete console.log

After this console messages will appear.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM