Tell us what’s happening:
Your code so far
function truncateString(str, num) {
var l=str.length;
if(l>num){
return str.slice(0,num-3)+"...";
}
else if(num<=3){
return str.slice(0,num)+"...";
}
else{
return str;
}
}
truncateString("A-tisket a-tasket A green and yellow basket", 11);
Your browser information:
Your Browser User Agent is: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:57.0) Gecko/20100101 Firefox/57.0
.
Link to the challenge:
> Blockquotestrong text