Tentukan JavaScript Teks Truncate

/**
 * Check if an element is truncated.
 */
function isTruncated(el) {
  return el.scrollWidth > el.clientWidth
}
nj-coder