Tagged: Closure

Finding Closure During A Monster Attack

Finding Closure During A Monster Attack

This week at Flatiron we’ve been diving into Javascript, and I came across the concept of closures. A closure is when you return a function inside a function in a way that the child function keeps reference to any variables defined in the parent function. Take the following example. If you wanted to specify a different target and weapon each time you...