0

I saw a function statement like this:

(function(){
     return new Object();
 })();

What does it mean?

1 Answer 1

2

IT means create an anonymous function and call it. One called it will return an object of Object. This type of functions are mostly written for some initialization tasks.

(function(){

    // do some init work here...
 })();
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.