Truncates a string to the specified maximum length
vx.x.x
The truncated string.
// Truncated to 3 lengthsconsole.log( truncate('example', 3))=> 'exa'
The string to truncate.
The maximum string length.
Truncates a string to the specified maximum length
Since
vx.x.x
Returns
The truncated string.
Example