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

  • Home
  • SEARCH
  • 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 6691415
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:44:57+00:00 2026-05-26T05:44:57+00:00

in a case i have a little framework for the public , how can

  • 0

in a case i have a little “framework” for the public , how can i make my own “workspace”? so i can use what ever variable name i want?

how can i make it done?

  • 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-26T05:44:58+00:00Added an answer on May 26, 2026 at 5:44 am

    Use an anonymous function wrapper. Any variables which are defined using var will not be available for the code outside the wrapper. Whenever you want to define a method or property, add them to the tobepublic object (which is returned at the end).

    var your_namespace = (function(){
        //Your own "workspace"
        var tobepublic = {};
        //Define any attributes and methods which should be public on tobepublic
        tobepulic.helloWorld = function(){
            alert("Hi!");
        }
    
        return tobepublic;
    })();
    

    Publicly, the above code looks like the code below. The methods above, however can also have access to private methods/variables, which cannot be seen “from the outside”:

    var your_namespace = {
        helloWorld: function(){
            alert("Hi!");
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my case I have panels,but to make it clear I will use buttons
Case One Say you have a little class: class Point3D { private: float x,y,z;
In case I have .NET framework installed in my computer + all the necessary
I have a C module and I want to refactor a little bit. There
I want use a Linq IQueryable Toolkit in project on .NET Compact Framework. The
Here's my case: I have a table view showing contacts. Add button in the
I have a regular .NET application. In this case I have a part that's
I'm new to codeigniter this is my case: I have a homepage with a
In general, how expensive is locking in Java? Specifically in my case: I have
I have a case where a 3rd party ad is bleeding through my modal

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.