function currentLine(katzDeliLine) { if (katzDeliLine.length > 0) { var textToPrint = \"The line is currently: \" for (var crrLine = 0; crrLine &
You can use regex to remove the last comma
$ is for matching the end of the string
$
let line = 'string1, string2, string3, string4, string5,' console.log(line.replace(/,$/g,''))