Good day!
Increasingly, in js scripts I come across variable declarations using the dollar sign, i.e. instead of a simple declaration var A, I see var $ A , and then by the access code for this variable, then so is $ A , then so is $ (A) . Here, for example, a piece of the script:
var forms = function(){ $('.js_form').each(function(){ var $form = $(this), $customField = $form.find('[data-error]'), customFieldRulls = {}; var zIndexs = function(){ setTimeout(function(){ $('label.error').each(function(i){ $(this).css({'z-index':'50'-i}) }); },200) }; Both ordinary variables and "variables with the dollar" are used. I do not understand what the difference between them? Is it just done for convenience, or does it provide something extra from a functional point of view?