Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

truncate function react

const truncate = (str, n) => {
		return str?.length > n ? str.substr(0, n - 1) + "..." : str;
	};
 
PREVIOUS NEXT
Tagged: #truncate #function #react
ADD COMMENT
Topic
Name
3+4 =