I am beginner trying to learn javascript from w3school, help to understand below code. if I remove + operator then I am getting only "Mango" in my output but why?
can any one explain using += operator if there is any similar examples please provide link if available with video explanation.
const fruits = ["Banana", "Orange", "Apple", "Mango"];
let fLen = fruits.length;
let text = "<ul>";
for (let i = 0; i < fLen; i++) {
text += "<li>" + fruits[i] + "</li>";
}
text += "</ul>";
document.write(text);