function truncateString(str, num) {
return `${str.slice(0,num)}...`;
}
console.log(truncateString("A-tisket a-tasket A green and yellow basket","A-tisket a-tasket A green".length + 2));
What is Wrong with this code It as pass the test but not accepted by freeCode Camp
Check It Out