JavaScript is a unique programming language and an integral component of the browser, its syntax and semantics so organically embody the best traditions of modern algorithm development that they are in many ways an example for other languages that present similar capabilities in a more cumbersome version.
JavaScript's indexOf method does not position itself as a search operation, but it can be used to determine where a character or substring is in a string. The same method applies to regular arrays.
General description of the method
The general style of JavaScript syntax determines that strings and arrays have an indexOf method that calculates where the desired substring (or just a character) begins in the string where this method was applied.
«». «var» , . - JavaScript.
, , , , .
: - «str», - «arr» - «ass». - id='scCurrInfo', . indexOf JavaScript .
() . .
JavaScript indexOf array : - . , , , indexOf array .
JavaScript: indexOf string.
, - . indexOf .
(, ) indexOf, JavaScript : , ().
, : ( ), (). .
, - «-1».
, , . , . . DOM - , indexOf JavaScript .
JavaScript, - , , « ».
, . , .
, , : : .
, , .
, , , indexOf .