So I tried looking for this in the search but the closest I could come is a similar answer in several different languages, I would like to use Javascript to do it.
T
> var firstNonRepeatedCharacter = function (str){ > for(i=0;i if(str.indexOf(str.charAt(i)) === str.lastIndexOf(str.charAt(i))){ > console.log(str.charAt(i)); > break; > } } } > > firstNonRepeatedCharacter ("areerak");
you can check below link
https://codepen.io/t3veni/pen/wvvxJzm