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

Tell us what’s happening:

I have checked other codes also but not able to understand what is wrong in my code. Can anyone help me please ?

Your code so far

const truncateString = (string, number) => {
  if(string.length<=number) return string;
  let result = string.slice[0,number] + '....';
  return result;
}

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.1 Safari/605.1.15

Challenge Information:

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

Is this valid syntax?

How many dots?

It is not working on three dots also. What should I do now ?

reference this, and double check your syntax

if you want more help share the code you have at this point