Menu
hellow guys , have a look at the below function , which checks for an element in an array ::
[CODE] inArray: function( elem, arr, i ) {
var len;
if ( arr ) {
if ( indexOf ) {
return indexOf.call( arr, elem, i );
}
len = arr.length;
i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0;
for ( ; i < len; i++ ) {
// Skip accessing in sparse arrays
if ( i in arr && arr[ i ] === elem ) {
return i;
}
}
}
return -1;
},
can somebody tell me what is this if check for below in the above fucntion ::
[CODE]if ( indexOf ) {
what is this check really doing ?
Thank you.
Gautam.