Solución
solution.tsTypeScript
const truncateString = (text: string, max: number): string => text.length > max ? text.slice(0, max) + '...' : text;
export { truncateString };0respuestas
const truncateString = (text: string, max: number): string => text.length > max ? text.slice(0, max) + '...' : text;
export { truncateString };Aún no hay respuestas
¡Sé el primero en responder!
Recuerda ser amable. Estás comentando la solución de otra persona. Comparte tu perspectiva de forma constructiva y respetuosa.