I’m having a little trouble wrapping my head around the $ sign being an alias for the jQuery function, particularly in a plugin. Can you explain how jQuery achieves this ali
A function, like any object in javascript, can be assigned to a variable. This variable can have any name (that follows the JS variable naming rules). "$" satisfies the naming rules, so the jQuery function is aliased to "$" for brevity. Consider the following example:
var myFn = function() { alert('myFunc'); };
var $ = myFn;
$();
// alerts 'myFunc'