MCPcopy Create free account
hub / github.com/unconed/TermKit / indexOf

Function indexOf

HTML/external/syntaxhighlighter_3.0.83/src/shCore.js:532–541  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

530 * @return {Number} Returns index of element if found; -1 otherwise.
531 */
532function 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.

Callers 1

shCore.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected