Basic Algorithm Scripting: Truncate a String problem

I’m having trouble with two of the tests that are the complete length of the string so it is not truncated.
Can anyone tell me why my code is failing the two tests?
Thanks.

function truncateString(str, num) {
  // Clear out that junk in your trunk
  if (num >= str.length){
    return str + "..."
  }
  else if (str.length > num){
    return str.slice(0, num) + "...";
  }
  else{
    return str;
  }
  
}

https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-algorithm-scripting/truncate-a-string

you only need to put the three dots in there when the string is too long

This got rid of one of the two but the one that is .length +2 is failing

function truncateString(str, num) {
  // Clear out that junk in your trunk
  if (num > str.length && num !>= str.length){
    return str + "..."
  }
  else if (str.length > num){
    return str.slice(0, num) + "...";
  }
  else{
    return str;
  }
  
}

truncateString("A-tisket a-tasket A green and yellow basket", 8);

In your earlier code, note that the condition in the if-block is exactly the opposite of the condition in the else-if-block.

num !>= str.length

You can’t put a ! before >=. The inverse of >= is just <

That was it

Thank you