how tocheck in index of array in javascript code example Example: indexof javascript Array.indexOf(searchElement, fromIndex)