Open bdougie opened 3 years ago
This is a comment with code
function() {};
This is code
export default function truncate(str, length = 100, ending = '...') {
if (str.length > length) {
return str.substring(0, length - ending.length) + ending;
}
return str;
}
How to write a loop in JavaScript