0

I am working on a site that is using Prototype. We had to embed a pure JS app into the page.

Unfortunately, Prototype library added like 20 new methods to Array object-prototypes. This is bad because the existing pure JS app is looping over Arrays, and so instead of getting just the strings of the array keys, it's getting function definitions for the new methods.

Like:

function clone() { return slice.call(this, 0);} (undefined%)

is an Array key now when I iterate over it. I know it's prototype because it adds to the prototypes and thats why no one uses it over jQuery anymore.

How can this be fixed?!

Ryan
  • 14,392
  • 8
  • 62
  • 102
y2k
  • 65,388
  • 27
  • 61
  • 86
  • 2
    Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the [How to Ask](http://stackoverflow.com/help/how-to-ask) page for help clarifying this question. – Ryan May 29 '14 at 19:05
  • 2
    Rather [fix your existing app](http://stackoverflow.com/q/500504/1048572) to use proper array iteration. – Bergi May 29 '14 at 19:17

0 Answers0