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

Tell us what’s happening:

I’ve looked all over the forum and elsewhere, cannot figure out what the issue is

Your code so far

function truncateString(string,num){
  if (string.Length > num){
    return string.slice(0,num) + "..." ;
  } else {
    return string
  }
}
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) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36 OPR/127.0.0.0

Challenge Information:

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

are you sure that the length of a string is written like that?