var ul = document.querySelector(".people");
const people = ["david", "nika", "jozica", "domen", "eva", "denis"];

let html = ``;

people.forEach(person => {
    // create HTML template
    html += `<li style="color: purple">${person}</li>`;
});

console.log(html);
ul.innerHTML = html;