What the character is used in javascript to delete the last line when printing out

I’ve a function that print out this format:

{
"name": "Google",
"url": "https:/google.com"
}
,
{
"name": "Facebook",
"url": "https://wts-kalix.polystar.net/Kalix/#/portal/619551b520fbf40c1cf22bad/618419244a4be06500ba0e8a"
}
,

And i need to delete the last comma so that the JSON format become valid which character should i use when it prints out