Linked Questions
69 questions linked to/from Why do you need to invoke an anonymous function on the same line?
1 vote
2 answers
75 views
Where does the event-variable come from?
I'm trying to understand this javascript-code: onMouseMoved = (function(_this) { return function(event) { dx = (event.pageX/3) / window.innerWidth; dy = (event.pageY/3) / window....
1 vote
3 answers
70 views
If you define an object in an anonymous function -- how do you use it?
I am looking at this tutorial. I know that it is using an anonymous function, from this answer: Why do you need to invoke an anonymous function on the same line? I understand that the () at the end ...
-1 votes
4 answers
61 views
javascript strange behavior needed explanation
for(i=0; i< 3; i++){ (function(i){ console.log(i) })(i); } I've encountered this and was wondering how it works (I understood the result, just want some deeper explanation on the (...
-4 votes
2 answers
94 views
how does jquery make the $ do what it does? [duplicate]
In order to use the $ symbol in jquery and not have to use jQuery.functionname, we use this (function($) { })(jQuery); (In drupal, you actually have to specify this implicitly). I don't ...
0 votes
2 answers
71 views
Difference between declared function with name and without name [duplicate]
can anybody tell me whats the difference between this two examples: //difference with this: var x = function withName(a,b,c) {} //why i should declare a name here? //and this var y = function (a,b,c)...
-1 votes
1 answer
78 views
Reading a cell in a Google script fonction and uses it in a fonction #inception
need help, i try to read a cell in this fonction. I've tried 20 differents type of thing, i always have this error message when i run the focntion on my spreadsheet : Message details : Cannot ...
-1 votes
2 answers
71 views
Self invoked Javascript function
I am working with a bit of code which has the following Javascript function. I have read this SO article which has explained things a little bit but I am still a bit confused as to how this code ...
1 vote
0 answers
47 views
JS - (function(){} ()) What does it do? [duplicate]
I am trying something and I saw Facebook SDK's code: (function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = ...
0 votes
0 answers
37 views
Can Anyone explain IIFE in javascript? [duplicate]
var Product = (function () { function Product() { } return Product; }()); For example note the above function, It is creating a IIFE function inside that another function is created ...