0

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.

Amir
  • 161
  • 3
  • 15

1 Answers1

1

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

delete console.log

After this console messages will appear.

Community
  • 1
  • 1
Dmitry Sadakov
  • 2,128
  • 3
  • 19
  • 34