{infiniteZest}
// Articles. Tutorials. Utilities.
Home  |   Search  |   Login  
Categories Skip Navigation Links
New / All
AJAX
Apple
ASP.NET
.NET
Git
Google / Android
Python / IronPython
Miscellaneous
SQL Server
AJAX Source Viewer
View the source code of a Method from ASP.NET AJAX Library. Choose a method from the menu items above (Namespaces, Classes, or Methods).
Method 'indexOf(array, item, start)'
Method: indexOf(array, item, start)
Method Full Name:     Array$indexOf(array, item, start)
Class: Array
Namespace: Global (MicrosoftAjax.debug.js)
Source File: MicrosoftAjax.debug.js
1   Array.indexOf = function Array$indexOf(array, item, start) {
2     /// <summary locid="M:J#Array.indexOf" />
3     /// <param name="array" type="Array" elementMayBeNull="true"></param>
4     /// <param name="item" optional="true" mayBeNull="true"></param>
5     /// <param name="start" optional="true" mayBeNull="true"></param>
6     /// <returns type="Number"></returns>
7     var e = Function._validateParams(arguments, [
8     {name: "array", type: Array, elementMayBeNull: true},
9     {name: "item", mayBeNull: true, optional: true},
10    {name: "start", mayBeNull: true, optional: true}
11    ]);
12    if (e) throw e;
13    if (typeof(item) === "undefined") return -1;
14    var length = array.length;
15    if (length !== 0) {
16      start = start - 0;
17      if (isNaN(start)) {
18        start = 0;
19      }
20      else {
21        if (isFinite(start)) {
22          start = start - (start % 1);
23        }
24        if (start < 0) {
25          start = Math.max(0, length + start);
26        }
27      }
28      for (var i = start; i < length; i++) {
29        if ((typeof(array[i]) !== "undefined") && (array[i] === item)) {
30          return i;
31        }
32      }
33    }
34    return -1;
35  }
This is the JavaScript source for method indexOf(array, item, start) from ASP.NET AJAX Library. Full name for this method is Array$indexOf(array, item, start). It belongs to the class Array, which is in Global (MicrosoftAjax.debug.js) namespace. This source is in MicrosoftAjax.debug.js file.
Bookmark and Share This
About  Contact  Privacy Policy  Site Map