
array.indexOf() – Returns the first index at which a given element can be found or `-1`.
๐ Syntax
index = array.indexOf(searchElement[, fromIndex]);
๐งช Example
['a','b','a'].indexOf('a'); // 0
array.indexOf() – Returns the first index at which a given element can be found or `-1`.
index = array.indexOf(searchElement[, fromIndex]);
['a','b','a'].indexOf('a'); // 0
Comments
Post a Comment