In JavaScript functions, you will see the special “this” keyword used. Let’s see it in an example… The “this” keyword refers to the object itself. You will see this in object function properties often. Happy Coding! Clay Hess
When a function runs, it goes through its code, then completes. Everything goes out of scope. There are times when we might want some information to “hang around”. Let’s start by looking at an example… Within our IIFE, we have a variable (animalName). We also have a nested function that
In JavaScript, we can use what are called Immediately Invoked Function Expression, or IIFEs. These are helpful for having functions run immediately when they are defined, such as when initializing an application. Let’s imagine we have the following function… Normally, we would run this function by calling it as follows…