i am destructuring an array to create html elements based on the data but i am finding a hard time figuring out how to remove the ',' after destructuring...
const elements = data.map((links) => {
const keys = Object.keys(links);
return `<div class="links"><p class="${keys[0]}">${links.website}</p>
<a href=${links.url} class="${keys[1]}">${links.userName}</a></div>`;
});
result:
<div class="links"><p class="website">Linkedin</p>
<a href="https://www.linkedin.com/in/andresilveira717" class="url">André Silveira</a></div> **,**
the ',' is appearing on the DOM, how do i remove it ?
I tried to destructuring it to a string but then i am not being able to create elements based on criteria.
Here is the data:
export const data = [
{
website: "Linkedin",
url: "https://www.linkedin.com/in/andresilveira717",
userName: "André Silveira"
},
{
website: "Github",
url: "https://github.com/the717q",
userName: "@the717q"
},
{
website: "Twitter",
url: "https://twitter.com/the717q",
userName: "@the717q"
}
];