Pretty sure I’m doing it wrong but it passes all the tests
function truncateString(str, num) {
// Clear out that junk in your trunk
if (str.length > num) {
return str.slice(0, num) + '...'
}
return str;
}
Pretty sure I’m doing it wrong but it passes all the tests
function truncateString(str, num) {
// Clear out that junk in your trunk
if (str.length > num) {
return str.slice(0, num) + '...'
}
return str;
}