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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T00:04:20+00:00 2026-06-09T00:04:20+00:00

After no help via Google and a post, this is my guess: var MC

  • 0

After no help via Google and a post, this is my guess:

var MC = {};
MC.o_p = function ( type ) {
    return {
        model  :  type,
        result :  'continue',
        page   :  {},
        args   :  {},
        server :  {},
        hash   :  localStorage.hash
    }
};

which I call like this

var obj1 = MC.o_p( 'MUserTry' );

Here the object o_p is is “scoped” to MC. You can create multiple instances via the call above. The string MUserTry is passed in as the variable type and set to the object property model.

Will this work? I’m taking a break from trial and error at the moment, but what I need is to be able to create object literals of a certain form with multiple instances.

Related

How to create global, instance based objects from local scope?

  • 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-09T00:04:21+00:00Added an answer on June 9, 2026 at 12:04 am

    You can’t scope the resulting object. The o_p property is a member of an object, but the object that is returned by the function is not.

    An object literal is just the { ... } syntax used to create objects, so what you want to do is to create an object, not an object literal. (Creating an object literal would be done by putting code for an object literal in a string, and execute the string.)

    You are misusing the constructor function, but it will work. An object will be created, and the function will be called to initialise it, then the object will be discarded and replaced by the object that the function returns.

    Just remove the new keyword, so that you make a regular function call, and it will return the object.

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

Sidebar

Related Questions

After searching online and reading the Oracle documentation for this, I need some help
I am asking for help, after hours of trying to figure this out myself.
After some searches via Google, I can't think of other keywords and am still
I have been trawling google for answers to this but no luck. Any help
So I have a form that is submitted via an Ajax POST request. After
Passenger s and Taxi s run independently in different threads. After great help of
After some great help from Josh Mein with a Javascript Hide/Show menu, the menu
After a long time searching and trying I'm asking now for help: My situation:
After much googling and console testing I need some help with arrays in rails.
I need some help removing spaces after hiding certain HTML elements. In context, I

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.