DEV Community

loading...

Discussion on: Daily Challenge #60 - Find the Missing Letter

Collapse
cvanpoelje profile image
cvanpoelje

My solution in Javascript

const missing = arr => {
  const alphabet = "abcdefghijklmnopqrstuvwxyz".split("");
  arr = arr.map(item => item.toLowerCase());
  for (let i in arr) {
    if (!arr.includes(alphabet[alphabet.indexOf(arr[i]) + 1]))
      return alphabet[alphabet.indexOf(arr[i]) + 1]
  }
}