I came across this function while learning on freecodecamp and I am quite lost on how it works. I am relatively new to JavaScript and I would appreciate if someone could explain better on how function with parentheses around it works. I would be glad if a link with well detailed explanation is also provided.
arr1 = ["monday", "tuesday", "wenesday","thursday", "friday"];
(function() {
arr2 = [...arr1]; // change this line
arr1[0] = 'potato'
})();