Confusing Javascript class declaration

Posted by clutch on Stack Overflow See other posts from Stack Overflow or by clutch
Published on 2010-04-01T19:07:40Z Indexed on 2010/04/01 19:13 UTC
Read the original article Hit count: 228

Filed under:

I have some third-party Javascript that has statements like this:

FOO = function() {
   ...functions() ... 
   return { hash }
}();

It is working as designed but I'm confused by it. Can anybody define what this structure is doing? Is it just a weird way to create a class?

© Stack Overflow or respective owner

Related posts about JavaScript