* Finds an index of element in the array. * @ignore * @param {Object} searchElement * @param {Number} fromIndex * @return {Number} Returns index of element if found; -1 otherwise.
(array, searchElement, fromIndex)
| 530 | * @return {Number} Returns index of element if found; -1 otherwise. |
| 531 | */ |
| 532 | function indexOf(array, searchElement, fromIndex) |
| 533 | { |
| 534 | fromIndex = Math.max(fromIndex || 0, 0); |
| 535 | |
| 536 | for (var i = fromIndex; i < array.length; i++) |
| 537 | if(array[i] == searchElement) |
| 538 | return i; |
| 539 | |
| 540 | return -1; |
| 541 | }; |
| 542 | |
| 543 | /** |
| 544 | * Generates a unique element ID. |