Return the first word with the greatest number of repeated letters
This approach seems a bit overly-complicated - there are multiple loops over the word just to remove duplicates, count the letters, etc. I would suggest a simple loop over each word to count the number of repeated numbers, maintaining the max count so far, and then using a simple object mapping (or a Set could be used) to look up the max counts for each word. See the rewritten code below for an example of this.
Additionally, the indentation could be greatly improved. Perhaps the first level inside whichWord in your code was lost because of pasting it into the question. However, most JavaScript code is indented by 2 or 4 spaces inside each block.
I noticed that arrow functions are being used (e.g. letters.map((innerArr, i) =&gt; innerArr.map((letter, ii).... This is a feature of ecmascript-6 and thus other features from that standard could be used, such as const for any variable that is never re-assigned and let for any variable that needs to be reassigned (e.g. iterator variables, cumulative counts, etc.), as well as the spread syntax instead of using function.apply().
Rewritten code
Below is my first take at simplifying the code. It can be compared for performance in this jsPerf.


function maxMode(word) {
  if (word.length == 1) {
    return 0;
  }
  const counts = {};
  for (const letter of word) {
    counts[letter] = (counts[letter] ?? 0) + 1;
  }
  return Math.max(...Object.values(counts));
}
const whichWord = str =&gt; {
  const arr = str.split(' ');
  const mappings = arr.reduce((mapping, word) =&gt; {
    mapping[word] = maxMode(word);
    return mapping;
  }, {});
  const mappingCounts = Object.values(mappings);
  const highestNumber = Math.max(...mappingCounts);
  const indexToReturn = mappingCounts.findIndex(c =&gt; c == highestNumber);
  return Object.keys(mappings)[indexToReturn];
};
const strings = ['Hello a apple pie yellow', 'axaya zza'];
for (const string of strings) {
  console.log('whichWord('+string+'):', whichWord(string));
}



1https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String#Character_access
2https://stackoverflow.com/a/4051431/1575353