✂️Truncate Text

truncateText ⇒ string

Truncates text to a specified length and adds an ellipsis if necessary.

Kind: global variable Returns: string - The original or truncated text.

Param
Type
Default
Description

text

string

The text to be truncated.

[limit]

number

25

The maximum length of text before truncation (default is 25).

[fromEnd]

boolean

false

If true, truncation will be performed from the end of the text (default is false).

Last updated