Spot the bug in the text preview

from Unicode text
Node 24 intermediate 4 min 1 issue to find

Find why this preview function can corrupt user-perceived text.

JavaScript
function preview(message, maximumCharacters) {
  if (message.length <= maximumCharacters) {
    return message;
  }

  return `${message.slice(0, maximumCharacters)}…`;
}
Open in playground
Report an error