I have come across the operator += numerous times while working with JavaScript, but I am still unsure of its functionality. Can someone provide a simple explanation of what it does and how it can be used in JavaScript? I stumbled upon this example and I am struggling to grasp the concept.
var message = "";
if (document.getElementById("x") == "") {
message += "You must enter your last name."
}