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
let str = 'aabbcdd'; let val = str.split('').reduce((a, e)=>{ if(str.indexOf(e) == str.lastIndexOf(e)) {a = e }; return a}) console.log(val); // c