indexof string in reactjs code example
Example 1: indefOf
const beasts = ['ant', 'bison', 'camel', 'duck', 'bison'];
console.log(beasts.indexOf('bison'));
// expected output: 1
Example 2: indexof javascript
arr.indexOf(searchElement[, fromIndex])