I’m working on a Tic Tac Toe project and having trouble with a certain task. Build the functions that allow players to add marks to a specific spot on the board, and then tie it to the DOM, letting players click on the gameboard to place their marker. Don’t forget the logic that keeps players from playing in spots that
Tag: iife
How are IIFEs useful post ES6?
I’m learning JavaScript and I understand the general function types, closures, etc. But with IIFEs my initial reaction was “if its immediately invoked, why not just inline it”. So I went and read this article that describes “4 Practical Use Cases” for IIFEs. However, two of which are related to circumventing the scoping issues that come with vars (which are
Why does a named IIFE result in a ReferenceError outiside of it?
Why did I get “ReferenceError: Person is not defined” for the following code? Since function Person is run, it is first created. However, I cannot explain why it is not then recognized. My only thought is that IIFE ignores the name they are given. Answer You get the error because the name of a function created by a function expression