What is the difference between these two methods of writing $ instead of jQuery in WordPress [closed]
The first is a pattern called a closure. It’s not unique to jQuery. You could just as easily write (function(someVar) { // Inside the closure, someVar == “test” })(“test”); Basically, you’re manually passing jQuery into the closure by referencing the jQuery object externally and aliasing it to $ inside the context of the closure. The … Read more