const truncateString =(str, num) => { let newString = '' if (str.length > num){ newString = `${str.substring(0,num)}...` } return newString; }