get index of javascript code example
Example 1: indexof javascript
arr.indexOf(searchElement[, fromIndex])
Example 2: js index to index
let array = [5, "Foo", 3, "Bar"];
array.slice(2);
// Output = [3, "Bar"]
let string = "Volvo Cars";
string.slice(2);
// Output = "lvo cars"