Tell us what’s happening:
Two of the tests fail, is this a bug or do I really need to debug my code?
Your code so far
function truncateString(str, num) {
return str.length > num ? str.slice(0,num) + '...' : string;
}
truncateString("A-tisket a-tasket A green and yellow basket", 8);
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:82.0) Gecko/20100101 Firefox/82.0.
It is great that you solved the challenge, but instead of posting your working solution, it is best to stay focused on answering the original poster’s question(s) and help guide them with hints and suggestions to solve their own issues with the challenge.