What does this syntax mean " function(a,d){...}(Jquery,...); " [duplicate] - javascript

This question already has answers here:
What is the (function() { } )() construct in JavaScript?
(28 answers)
What does this symbol mean in JavaScript?
(1 answer)
Closed 2 years ago.
I know, similar questions have been asked but none answered my question of What does the second () mean?
And also no the syntax is not (function...) rather its just function(a,d){...}(Jquery,...);
Is it that we are making objects of Jquery, I am also using Hammer.js so basically the second paranthesis has (Jquery, Hammer)

Related

Cannot understand this javascript statement [duplicate]

This question already has answers here:
Javascript || operator
(5 answers)
Javascript Shorthand - What Does the '||' Operator Mean When Used in an Assignment? [duplicate]
(6 answers)
JavaScript OR (||) variable assignment explanation
(12 answers)
Closed 3 months ago.
The community reviewed whether to reopen this question 3 months ago and left it closed:
Original close reason(s) were not resolved
I've been given a function by a client to create a custom script for tracking purposes which is fine, but being new to JS I'm having trouble understanding this line of code:
d[p]=d[p]||function(){(d[p].q=d[p].q||[]).push(arguments);};
function example is:
(function (d,e,k,u,p) {
d[p]=d[p]||function(){(d[p].q=d[p].q||[]).push(arguments);};
var a=e.createElement(k),b=e.getElementsByTagName(k)[0]; a.async=1;a.src=u;b.parentNode.insertBefore(a, b);
}(window,document,'script','https://www.example.com/bundle.js','stringname'));
If anyone could explain it that would be great
Just want to understand the statement better, it works fine and I can copy and paste with the correct url and string name but better if I understand the statement

Anonymous function execution in JavaScript [duplicate]

This question already has answers here:
Explain the encapsulated anonymous function syntax
(10 answers)
Why are parentheses required around JavaScript IIFE? [duplicate]
(3 answers)
Closed 2 years ago.
Why if I have
function(){...}()
does not work while when I put inside brackets like
(function(){...}())
it works?

Function expression call in JavaScript [duplicate]

This question already has answers here:
JavaScript object functions and `this` when unbound and returned in expression/parens
(2 answers)
Closed 3 years ago.
I came across this (document.createElement)('a');.
How is it different from document.createElement('a');
No difference.
Please read doc for more.

JavaScript object properties copy syntax [duplicate]

This question already has answers here:
What does this symbol mean in JavaScript?
(1 answer)
What does curly brackets in the `var { ... } = ...` statements do?
(4 answers)
What do {curly braces} around javascript variable name mean [duplicate]
(1 answer)
Closed 4 years ago.
I was reading some JavaScript code and saw a line of code similar to this.
const {name, password, email} = user;
I tried searching around but could not figure out what this syntax is called so I am not able find the documentation. Is this a new JavaScript syntax? What is it called? What does it do exactly?

What is the name of this structure in JavaScript? [duplicate]

This question already has answers here:
What does (function($) {})(jQuery); mean?
(6 answers)
What is the (function() { } )() construct in JavaScript?
(28 answers)
Closed 5 years ago.
I see in the jQuery code this structure but I don't know the name and how use correctly.
(function($) {
...
})(jQuery);
I suppose it's a form of past arguments to the function.
this will execute the function immediately (immediately invoked)

Categories