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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T00:35:00+00:00 2026-06-15T00:35:00+00:00

If I wanted to access a value within itself (an object), how would I

  • 0

If I wanted to access a value within itself (an object), how would I go about doing so?

Here’s what I have (simplified):

options = {
    'image' : {
        'height' : {
        'upper' : 100,
        'lower' : 25
        },
        'width'  : {
        'upper' : 100,
        'lower' : 25
        },
    'dimensions' : (Math.floor(Math.random() * (options.image.height.upper - options.image.height.lower) + options.image.height.lower)) + 'x' +                                                         (Math.floor(Math.random() * (options.image.width.upper - options.image.width.lower) + options.image.width.lower())),
        'color' : 'fff'
};

If you look at options.dimensions, I’m attempting to access the values in height and width, yet I believe my scope is wrong.

Is there a way to access what I need the way I’m doing it? If not, what’s a better way to go about this?

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-15T00:35:01+00:00Added an answer on June 15, 2026 at 12:35 am

    Do it in two steps:

    options = {
        'image' : {
            'height' : {
                'upper' : 100,
                'lower' : 25
            },
            'width'  : {
                'upper' : 100,
                'lower' : 25
            },
            'color' : 'fff'
        }
    };
    
    options.dimensions = (Math.floor(Math.random() * 
        (options.image.height.upper - options.image.height.lower) + options.image.height.lower)) + 
        'x' + (Math.floor(Math.random() * (options.image.width.upper - options.image.width.lower) +
        options.image.width.lower()));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Good day I wanted to have a general URL to access the Desktop of
I would like to have thread-safe read and write access to an auto-implemented property.
I am pretty sure I am doing something wrong here. I have been developing
I wanted to access my existing .db file from sdcard using phoneGap but method
I am developing a blackberry application and i wanted to access the websites from
I wanted to insert multiple records in MS Access file from java Servlet. The
I wanted to know is C# array has a constant access speed? I need
There are couple of ways to access azure storage services. And I wanted to
Wanted to see if anyone knows how to add props to a image with
Say I have these JavaScript objects: questions = { name: Age, options:[boy, girl, daddy]}

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.