get first occurence of character in string javascript code example Example: indexof javascript Array.indexOf(searchElement, fromIndex)