Side navigation
Ticket #5160: patchInArray.txt
File patchInArray.txt, 0.4 KB (added by lrbabe, September 03, 2009 02:05PM UTC)
Index: core.js
===================================================================
--- core.js (revision 6533)
+++ core.js (working copy)
@@ -409,12 +409,12 @@
},
inArray: function( elem, array ) {
+ if(array.indexOf) return array.indexOf(elem);
for ( var i = 0, length = array.length; i < length; i++ ) {
if ( array[ i ] === elem ) {
return i;
}
}
-
return -1;
},
Download in other formats:
Original Format
File patchInArray.txt, 0.4 KB (added by lrbabe, September 03, 2009 02:05PM UTC)
Index: core.js
===================================================================
--- core.js (revision 6533)
+++ core.js (working copy)
@@ -409,12 +409,12 @@
},
inArray: function( elem, array ) {
+ if(array.indexOf) return array.indexOf(elem);
for ( var i = 0, length = array.length; i < length; i++ ) {
if ( array[ i ] === elem ) {
return i;
}
}
-
return -1;
},