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