Implement the Truncate String Algorithm - Implement the Truncate a String Algorithm

Tell us what’s happening:

Hello, I’m not sure of why my code isn’t valid here. The data my function outputs is a string afaik and the cut is made where it should. The result is the same as described in the user story.

Your code so far

function truncateString (string, num){
if (string.length > num){
  const stringMax = string.slice(0, num);
  const cutString = `${stringMax}... `;
  return cutString;
}else return string;
}
truncateString("A-tisket a-tasket A green and yellow basket", 8);
console.log(truncateString("A-tisket a-tasket A green and yellow basket", 8));

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:152.0) Gecko/20100101 Firefox/152.0

Challenge Information:

Implement the Truncate String Algorithm - Implement the Truncate a String Algorithm

GitHub Link: freeCodeCamp/curriculum/challenges/english/blocks/lab-truncate-string/ac6993d51946422351508a41.md at main · freeCodeCamp/freeCodeCamp · GitHub

you are adding an extra character with this space after the ...

Thank you, saw that half an hour after posting but could not delete it while it was pending.