- [Narrator] The first thing we're going to start with…is an IIFE function,…or an immediately invoked function expression.…We'll revisit this in another video…where it'll have a little bit more meaning.…Just know that by wrapping our code in a function…and immediately running it,…the internal variables are unavailable to the outside…keeping our variables safe.…An IIFE looks like this.…It's basically two parens and inside the first paren…we're going to use an anonymous function.…And again this is just a pattern that…allows the function to run immediately.…
We'll start the code with a ;…just in case this is is ever minimized…and the proceeding code doesn't end with a ;…and of course we'll end ours with a ;.…Let's copy and paste our pseudo code and indent it.…We'll be working with a game object…and that's just going to be a simple function.…So var game = function…and we'll pass in two parameters.…First the element and the option.…
The element is going to be…the element we're going to drop our game into…and options is going to tell us what game we want to play.…
- Working with prototype and dynamic elements
- Using bind, call, and apply
- Using the Fisher–Yates formula
- When to use e.preventDefault() and when to avoid it
- Drag-and-drop life cycle
- Using prototypical inheritance to optimize your code
Skill Level Intermediate
Q: This course was updated on 1/16/2019. What changed?
A: The following topics were updated: propagation and drag and drop.