trim text and add ... js
const truncate = (input) => input.length > 5 ? `${input.substring(0, 5)}...` : input;
Are there any code examples left?
New code examples in category Javascript
const truncate = (input) => input.length > 5 ? `${input.substring(0, 5)}...` : input;