Closed contolini closed 8 years ago
Makes sense. I added the following as what will appear as a "note" in the final version of the book:
Note: The example above is wrapped in an Immediately-Invoked Function Expression (IIFE), which may look a bit odd if you're not a JavaScript developer. This ensures that the code executes immediately while avoiding the pollution of the global scope. If you are interested in learning more Ben Alman has written a very detailed post about IIFEs.
:+1:
Non-JS folks may wonder what all the weird parens are doing in the following example:
Might be worth adding a footnote explaining that the IIFE is unrelated to the
visibilityState
check.