Answer the question
In order to leave comments, you need to log in
How does this construct work in JavaScript?
Hello!
Please explain in simple terms.
How does this construct work in JavaScript?
var module = (function (obj) {
//code
})(module || {});
Answer the question
In order to leave comments, you need to log in
So it will be more clear?
function f(obj){
//code
}
var module = f(f() || {});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question