Results 1 to 4 of 4

Thread: Help! I'm not able to understand the syntax in<Tutorial:What is that Scope all about>

  1. #1

  2. #2
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,248

    Default

    The tutorial is explaining how scope works.

    The last function call is showing how you can call a method and tell it to run in a particular scope. Even though the method is being called on o1, the scope of o2 is being used. As such, "this" is a reference to o2, not o1.

  3. #3
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,892

  4. #4

    Default

    OK! I I knew it now!
    o1.fun(); '1'
    o2.fun(); '2'
    o1.fun.call(o2); '2'

    The codes behind calling function statement just are comments.
    Maybe it's more well-understand like this.

    o1.fun(); //we get '1'
    o2.fun(); //we get '2'
    o1.fun.call(o2); //we get '2'


    THANKS!!!

Posting Permissions

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