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 8710473
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T04:38:03+00:00 2026-06-13T04:38:03+00:00

According to Javascript’s major implementations, the lookup for variables and functions starts at the

  • 0

According to Javascript’s major implementations, the lookup for variables and functions starts at the spot and traversing upwards until the global objects.

Now lets say you’re building larger OOP based frameworks and you need to call safety checks all over the place, then it doesnt seem right to call those things that way : “xapp.utils.isValidString(var). The same applies to constants, enumerations and flags which take place everywhere usally.

I am not quite sure whether this has impacts on the answer but we’re doing all in Dojo and we are pretty aware about its lang.mixin method.

However, the idea is to mixin an obvious and minimal set of functions and objects into the target objects local scope by using the constructor or prototype. Would you consider this to be a legal way ?

Then what about caching and reusing those prepared objects ? Which kind of buffer you would choose ? To me it looks rather like an ring buffer.

I am still learning JS optimization and I would be happy about your thoughts !

For your reference, here some common tips about scope managment explained by a guru : http://googlecode.blogspot.com.es/2009/06/nicholas-c-zakas-speed-up-your.html

Update : We need to focus only on modern desktop and mobile browsers, leaving IE totally out !
Also, we’re familiar with Dojo’s build chain, enabling conditional compiling per platform (If that matters).

  • 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-06-13T04:38:04+00:00Added an answer on June 13, 2026 at 4:38 am

    As for identifier resolution, i.e. direct references, I recommend that you switch to the strict language (if you already haven’t), a.k.a. “strict mode”. The strict language is statically scoped, which enables JS engines to statically bind the identifiers, which results in better performance during program execution (the identifiers have already been bound during compilation).


    As for property look-ups, if you have long chains, e.g.

    foo.bar.baz.method1();
    foo.bar.baz.method2();
    

    the usual solution (not just for performance, but also to avoid code repetition) is to store the right-most object into a local variable:

    var baz = foo.bar.baz;
    
    baz.method1();
    baz.method2();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In Javascript I need to order objects in an array according to type. Each
I am wondering how JavaScript's reserved keywords / functions are managed. Example: According to:
I'm having an odd issue where, according to Javascript (in Chrome), all of the
According to this website calling removeChild() in JavaScript causes an Internet Explorer Specific leak
According to convention, I'm importing an initializing JavaScript file into my jQuery Mobile pages
According to the documentation here: https://github.com/playframework/Play20/wiki/AssetsGoogleClosureCompiler it says: Any JavaScript file present in app/assets
GWT compiles the Java source into Javascript, and names the files according to a
I have several onmouseover events (combination of javascript functions and jquery accordions) but they
According to Wikipedia, IE8 only supports Javascript 1.5. So they are saying IE8 completely
is there any javascript library for resizing the images according to browser window sizes

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.