Подскажите в чем ошибка, всегда возвращается false;

Вот задание:

Return true if none of the letters in the blacklist are present in the phrase. If at least one letter from blacklist is present in the phrase return false;

Comparison should be case insensitive. Meaning 'A' == 'a'.

Вот мои попытки:

function hasNoneLetters(blacklist, phrase) {
  let blacklistChars = blacklist.split("");
  let phraseChars = phrase.split("");
  let result = true;
  for (let i = 0; i < blacklistChars.length; i++){
    let charTest1 = blacklistChars[i];
    for (let j = 0; j < phraseChars.length; j++){
      let charTest2 = phraseChars[j];
      if (charTest1.toUpperCase === charTest2.toUpperCase){
        result = false;
      } 
    }    
  }
  return result;
}

False возвращается всегда, независимо от того, есть совпадения или нет. Как фиксить?


Ответы (0 шт):