Results 1 to 4 of 4

Thread: Private instance member

  1. #1
    Sencha User
    Join Date
    Sep 2012
    Location
    Ljubljana
    Posts
    23
    Vote Rating
    0
      0  

    Default Answered: Private instance member

    How can you make private instance member?

  2. Javascript doesn't really have a concept of private anything, the only way is with a closure.

  3. #2
    Sencha User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,050
    Answers
    3976
    Vote Rating
    1382
      0  

    Default

    instance member?
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Frontend Engineer
    ________________
    Need any sort of Ext JS help? Modus Create is here to help!

    Check out my GitHub:
    https://github.com/mitchellsimoens

  4. #3
    Sencha User
    Join Date
    Sep 2012
    Location
    Ljubljana
    Posts
    23
    Vote Rating
    0
      0  

    Default

    Quote Originally Posted by mitchellsimoens View Post
    instance member?
    When you create new object ("Class") and if there's any other way to make private variable than the one with closure.

    (function() {
    var foo = 'foo';
    return 'bar' + foo;
    })()

  5. #4
    Sencha User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,050
    Answers
    3976
    Vote Rating
    1382
      0  

    Default

    Javascript doesn't really have a concept of private anything, the only way is with a closure.
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Frontend Engineer
    ________________
    Need any sort of Ext JS help? Modus Create is here to help!

    Check out my GitHub:
    https://github.com/mitchellsimoens

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •