Missing Letters Problem

I’m having a problem getting my missing letters function to return undefined when there are no missing letters. Right now every time I run the function it only returns the missing letters (if there are any). If not, it returns a red dot. Could someone please explain what is going wrong?

function fearNotLetter(str) {
  
  var newStr = [];
  
  var oddValue = [];
  
  for (i=0; i < str.length; i++){
    
    newStr.push(str.charCodeAt(i));
    
    if (newStr[i] == (newStr[i-1] +2)) {
        oddValue.push(newStr[i] - 1);
      }
  }
  
  
  if (oddValue === []) {
    return undefined;
  }
  else {
    return String.fromCharCode(oddValue);
  }
}

I cleaned up your code.
You need to use triple backticks to post code to the forum.
See this post for details.

[] !== []



const isArrayEmpty = (array) => array.length === 0

isArrayEmpty( [] ) // true
isArrayEmpty( ['a', 'b'] ) // false