What does it mean to include author.plugin inside the parenthesis at the end of this code?
It's simply an input for the function.
🙂 With a "normal" function, the function is defined and then called, e.g.
Code:
var sayThis = function(text) { console.log(text); };
var input = 'Hello world!';
sayThis(input);
By contrast, an IIFE defines the function in-line and evaluates it immediately because it's in brackets. It still takes input(s) from brackets after the function:
Code:
var input = 'Hello world!'
(function(text) { console.log(text); })(input);
Since
author.plugin was defined at the start (you can name them whatever you like within reason, they're just variables) this means we can pass it in as an argument of the function and refer to it by another name while inside that function. So, in this example, whenever you see
$ inside that IIFE, it represents
author.plugin. It's nice not needing to use the full name all the time, and definitely reduces the chance of making a typo~!