Q:

Is it possible to check the condition of a value of an object and JUST return the key?

I have an object of letters and numbers inside of a function. This function takes in an array of numbers and I'm running a for in loop that iterates over the object and checks a condition. If any of the numbers in the array match any of the values in the object, return just the key to that value. 
So If I pass in switcher(['26']), it should return 'a'. Is this possible?
function switcher(x){
const letters = {
  a: '26',
  b: '25',
  c: '24',
  d: '23',
  e: '22',
  f: '21',
  g: '20',
  h: '19',
  i: '18',
  j: '17',
  k: '16',
  l: '15',
  m: '14',
  n: '13',
  o: '12',
  p: '11',
  q: '10',
  r: '9',
  s: '8',
  t: '7',
  u: '6',
  v: '5',
  w: '4',
  x: '3',
  y: '2',
  z: '1'
};
}

I have attempted to do this via the ES6 map() method, but I am unsure as to what to put in my if statement.. Here is what I have so far:
return x.map(function(number){
  let keys = Object.keys(letters);
  for(var key in letters){
    if(letters[key] === number){
    }
  }
 });
}

Is there an easier way to do this? 

A:

You could use Object.keys and Array#find to get the key of the matched value.

const letters = {a:'26',b:'25',c:'24',d:'23',e:'22',f:'21',g:'20',h:'19',i:'18',j:'17',k:'16',l:'15',m:'14',n:'13',o:'12',p:'11',q:'10',r:'9',s:'8',t:'7',u:'6',v:'5',w:'4',x:'3',y:'2',z:'1'};

function switcher(num){
  var res = Object.keys(letters).find(v => letters[v] == num);
  return res;
}

console.log(switcher('26'));
console.log(switcher('9'));

