Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6030373
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T05:01:38+00:00 2026-05-23T05:01:38+00:00

As said here: http://jqfundamentals.com/book/index.html Closures can also be used to resolve issues with the

  • 0

As said here:

http://jqfundamentals.com/book/index.html

Closures can also be used to resolve issues with the this keyword,
which is unique to each scope. This
mechanism can be particularly useful
when dealing with callbacks, though in
those cases, it is often better to use
Function.bind, which will avoid any
overhead associated with scope
traversal.

But it doesn’t really say how to distinguish between the two cases. I don’t understand in fact what the author means by "avoid any overhead associated with scope traversal." Can you explain?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T05:01:39+00:00Added an answer on May 23, 2026 at 5:01 am

    Take a look at this line in the example in the link above

    console.log(self.myName, this.myName);
    

    (with self = this; a couple of lines above). The closure defined outerFunction method, exists in a different scope that is why it has a different this value from the outerObj object. (self.myName!=this.myName)

    Scope traversal means, when you are reaching to grab a value (variable,object) that exists in a different scope, therefore additional overhead is added (code becomes slower to execute).

    Using bind, you ‘re calling a function with an existing scope, so that scope traversal does not take place.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

From here http://blog.prabir.me/post/Undo-in-Git.aspx , it said This undo’s your commit and also resets your
I used a login script tutorial here: http://www.astahost.com/info/tilltf-simple-login-script-simple-secure-login-script.html and when I clocked login, there
It is said here http://code.google.com/intl/ru-RU/webtoolkit/tools/gwtdesigner/quick_start.html that one should Choose an appropriate panel type for
It is said here: http://www.ibm.com/developerworks/web/library/wa-dbdsgn2.html Each table in the DB should have a history
How can i call perspectiveM static method in Matrix class? As said here: http://developer.android.com/reference/android/opengl/Matrix.html
It is said here http://msdn.microsoft.com/en-us/library/fa13yay7%28v=VS.90%29.aspx (see also http://msdn.microsoft.com/en-us/library/s4wcexbc%28VS.90%29.aspx ) Use this option if you
It is said here http://msdn.microsoft.com/en-us/library/ee817669.aspx#observerpattern_topic3a This permits a subject to notify a potentially infinite
It is said here http://kivy.org/docs/gettingstarted/intro.html?highlight=iphone On your computer, you can create apps that run
It is said here: http://msdn.microsoft.com/en-us/library/aa211599%28v=office.11%29.aspx Before the procedure will run, you must connect the
It is said here: http://msdn.microsoft.com/en-us/library/ms753358.aspx Sometimes, the typical technique of backing your property with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.