JSFiddle - React, Tailwind, and code Playground

by swoogie

JavaScript

var word = "Google",
    lookup = {},
    answer;

word.split("").forEach(function(e){
    e = e.toLowerCase();
    lookup[e] = lookup[e] + 1 || 1;
});

for(key in lookup){
    if(lookup[key] == 1){
        answer = key;
        break;
    }
}
console.log(answer);