'How to add a space between the words "HTML" and "CSS" on the example below? [duplicate]

let languages = ["HTML", "CSS", "JavaScript"];

function FooterFunction() {
  document.querySelector(".footer-Paragraph").innerHTML = "This page was built using: " + languages.slice(0, -1) + " and " + languages.slice(-1);
}

FooterFunction()
<div class="footer-Paragraph"></div>


Solution 1:[1]

You can use array.join

languages.slice(0,-1).join(", ")

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1