AmitDhanawat / jquery-multi-open-accordion

Automatically exported from code.google.com/p/jquery-multi-open-accordion
0 stars 0 forks source link

Javascript Array object prototype #13

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
You change the prototype of global Array object. That's why when i use array I 
have bad behavior of array instance.

Example:
var array = new Array();
for(key in array){
     //you always have key "hasObject"
}

Original issue reported on code.google.com by iurii.pa...@gmail.com on 13 Jun 2012 at 11:26

GoogleCodeExporter commented 9 years ago
Another implementations of this (look comments): 
http://stackoverflow.com/questions/143847/best-way-to-find-an-item-in-a-javascri
pt-array for 

But I think changing the prototype of global Array object is done unnecessarily 
- 
jQuery has already a function to test if array has an specific value, u could 
do something like 

$.inArray(index,tabs) > -1

instead of 

if(tabs.hasObject(index)) {

Original comment by mene...@gmail.com on 5 Oct 2012 at 11:06