nassem1
10/2/2019 - 8:37 PM

how to cut title when is to long

const cutTitle = (result) => {
    if (result.length > 17) {
        let srt = result;
        let strTitle = srt.substring(0, 17)
        return strTitle + "..."
    } else {
        return result
    }
}

resutl = `<h1>${cutTitle(movie.title)} </h1>`