Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Script syntax explanation

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #242572
    ilyuha21st
    Participant

    Hello,

    Recently, I have seen js sugar like:

    var MyClass1 = (function()
    {
        /* Some code here... */
    } )();
    

    And something like:

    var MyClass2 = (function()
    {
        /* Some code here... */
    } )(anther_variable);
    

    Can some give a reference or explain about those two? Thank you.

    #242638
    Shikkediel
    Participant

    You may find this helpful.

    http://stackoverflow.com/q/18203897/3168107

    #242713
    ilyuha21st
    Participant

    Thank you

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.