I found this code in the beta.freecodecamp.org website.
const arr1 = ['JAN', 'FEB', 'MAR', 'APR', 'MAY'];
let arr2;
(function() {
"use strict";
arr2 = [...arr1]; // change this line
})();
console.log(arr2);
Maybe some of you think that this is pretty normal, but i found something strange and very new to me.
Like, this;
What is this thing? => ( <= function() {
...
} => )() <= and what is this too?
I mean, I want to know what it means by adding this " ( " sign before the ‘function’ word. And why does it end with " ) (); ".
Does it make a difference with writing it like this?
function() {
...
};
What does that mean? Can someone tell me? It’s really new to me.