Basic issues of javascript and jQuery

when creating jquery functions for wordpress, each time you add methods

function (){
   jQuery(....)
}

is there any way to change it directly into $?

Jul.28,2021

define plug-ins

(function($){
    $.fn.extend({
        demo:function() {
            // ...
        }
    })
})(jQuery);

define global

jQuery.extend({
    demo:function() {
        // ...
    }        
});

A batch of functions can be defined centrally by closure

(function($, _){
    _.1 = function() {
        $(....)
    }
    _.2 = function() {
        $(....)
    }
})(jQuery, window);

or you can use two $symbols

var $$ = jQuery.noConflict();

define plug-in anonymous self-execution function encapsulation, pass jquery in,

Menu