0
|
1 //>>excludeStart("exclude", pragmas.exclude);
|
|
2 define([ "shoestring" ], function(){
|
|
3 //>>excludeEnd("exclude");
|
|
4
|
|
5 /**
|
|
6 * Check for array membership.
|
|
7 *
|
|
8 * @param {object} needle The thing to find.
|
|
9 * @param {object} haystack The thing to find the needle in.
|
|
10 * @return {boolean}
|
|
11 * @this window
|
|
12 */
|
|
13 shoestring.inArray = function( needle, haystack ){
|
|
14 var isin = -1;
|
|
15 for( var i = 0, il = haystack.length; i < il; i++ ){
|
|
16 if( haystack.hasOwnProperty( i ) && haystack[ i ] === needle ){
|
|
17 isin = i;
|
|
18 }
|
|
19 }
|
|
20 return isin;
|
|
21 };
|
|
22
|
|
23 //>>excludeStart("exclude", pragmas.exclude);
|
|
24 });
|
|
25 //>>excludeEnd("exclude");
|