In a code in TypeScript I saw
(() => {
const abc = 'blabla';
...
})();
What does this syntax mean exactly ? I know arrow functions is JS - so I understand this:
() => {
const abc = 'blabla';
...
});
But what is the interest of the rest of parenthesis ?
PS: The original code is
(() => {
const title = 'New Document'
NewDoc.initialize = () => {
render(
<App title={title} />,
document.querySelector('#contnr')
);
};
render(
<Progr />,
document.querySelector('#contnr')
);
})();
Thank you
function), which is then called immediately. Given it isn't using athis- I think it could just usefunctionnotation instead.