Given a string, find the first non-repeating character in it and return its index javascript code example
Example: first non repeating character javascript
function firstNotRepeatingCharacter(s) {
for (let i = 0; i < s.length; i++) {
if(s.indexOf(s.charAt(i)) == s.lastIndexOf(s.charAt(i))) {
return s.charAt(i)
}
}
return '_'
}