People using that kind of code should be flogged to death with the complete works of Donald Knuth.
Decompiling that mess:
() => { alert("2") }
// an unnamed function that displays a popup. Let's call it Bob
window.addEventListener("click", Bob)
// This system call makes Bob the browser window click handler
() => { call Bob when you click on the browser window }
// yet another unnamed function invoking the above. Let's call it Bertie.
(Bertie)()
// Bertie gets called, setting Bob as the browser window click handler
const BoardGame = (Bertie)()
// BoardGame is assigned the return value of a function that doesn't provide any,
// thus being set to `undefined', which was also its previous value
// as a not yet defined variable, so this bit does not change much
// in the grand scheme of things
Instead of these hieroglyphs, you could have taken 3 minutes to give some names to these functions, like so:
function OnWindowClicked () {
alert ("2");
}
function SetupWindowClickHandler () {
window.addEventListener("click", OnWindowClicked);
}
const SomeUselessConstant = SetupWindowClickHandler();
There is exactly zero value to using lambda functions there, except maybe impressing the chicks with your mastery of pointlessly obfuscated JavaScript.
The idea behind using lambda functions is to avoid cluttering the toplevel namespace with lots of function names, but there are other ways to do so. And besides, you don't need any of this to program a tic tac toe.
Quite the opposite: it makes for horrible, unreadable code while you'd be better off with simple examples to get familiar with the basics of the language.