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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T21:31:27+00:00 2026-06-18T21:31:27+00:00

In JavaScript and other languages, I’ve heard about Activation Objects being created as you

  • 0

In JavaScript and other languages, I’ve heard about Activation Objects being created as you invoke a method / function. In order to optimize and maintain a good performance, it sounds like a developer should limit how many functions are being called.

Now if there’s no way around it and you must call multiple methods, is it better to call one method after another, like this:

myFunc1();
myFunc2();
myFunc3();

// or...
var myFuncs = [myFunc1, myFunc2, myFunc3];
for(var a=0, aLen=myFuncs.length; a<aLen; a++) {
  myFuncs[a]();
}

OR, to nest them like this:

function myFunc1() {
  // Do something...
  myFunc2();
}

function myFunc2() {
  // Do Something else...
  myFunc3();
}

function myFunc3() {
  //Do one last thing.
}

//Start the execution of all 3 methods:
myFunc1();

I’m assuming it makes more sense to go with the 1st technique, since it comes back to the previous scope and releases the last Activation Object… but if someone could confirm this,
I would really like to know!

Thanks

  • 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-18T21:31:28+00:00Added an answer on June 18, 2026 at 9:31 pm

    For information concerning Activation Objects, please refer to http://dmitrysoshnikov.com/ecmascript/chapter-2-variable-object/#more-546

    This is not an optimization level concern however, as the concern you listed is an example of EXTREME pre-optimization and your time is not worth that type of investment. And actually, the example you listed above, there is little to no savings when you are looking at Activation Objects alone.

    As for proper use however, I try to encapsulate as much as I can. If a function doesn’t have to go in the global scope, and can live within the scope of another function, then that’s where it should be declared.

    for example, for better scoping.

    
    var f2 = function() {
    }
    
    var f1 = function() {
      f2()
    }
    
    // is not as nice as:
    
    var f1 = function() {
      var f2 = function()
    
      f2()
    }
    
    // or even better.. 
    
    var f1 = function() {
      function() {
      }()  ; execute
    }
    
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

There are other questions about this in other languages , and other non-lazy JavaScript
I'm relatively new javascript, but I am comfortable in other languages. I'm trying to
I'm looking for a IDE that supports PHP/JAVA/CSS/HTML/JAVASCRIPT and possibly other languages. Jetbrains IntelliJ
Are there client side programming languages other than JavaScript in web development?
In other languages such as C# and JavaScript, I am able to access the
Are there other languages apart from javascript that browsers can interpret and execute. I'm
I am learning JavaScript from the basics (although I program in other languages such
This question has been asked before for other languages: Python , PHP and JavaScript
I am learning about creating objects in JavaScript. When I do this ... var
I learned that JavaScript is a loosely-typed language. What other languages are loosely-typed?

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.