1 line of code: How to truncate a string at word boundaries
const truncateAfterWord = (str, chars, placeholder = '…') =&gt;  str.length &lt; chars ? str :...
Tags: javascript, webdev, productivity, codequality