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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T02:48:56+00:00 2026-06-08T02:48:56+00:00

I have a very basic JavaScript question. I am writing a program which will

  • 0

I have a very basic JavaScript question.

I am writing a program which will generate JavaScript code. for accessing a property of a variable i have two choices:

1. make the property access a static query. i.e.
var result = object.property

OR

2. make the property access a dynamic query, i.e.
var result = object["property"]

The difference it makes to me is that for the first case (static query case) i will have to generate separate code for each property access. whereas in the second case (dynamic query case) i can reuse the same function for every property.

I can decide if i know does this makes any difference in performance?

is obj.property faster or obj["property"]?

May be this also depends on the engine which will be used to interpret javascript, so i must mention that I will be using Rhino as my javascript engine.

So please throw some light on this issue.

Thanks,
Regards,
VImal

  • 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-08T02:48:58+00:00Added an answer on June 8, 2026 at 2:48 am

    There are no static properties in Javascript, only dynamic property accessing exists.

    Properties are always queried in the same way regardless of what syntax you put in your source code file.

    Use jshint to recommend good source code conventions for your JS files:

    http://jshint.com/

    Dot notation is always recommended. Use quotation mark notation only if your Javascript property has not id which passes in JS syntax.

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

Sidebar

Related Questions

I am new to javascript and have a very basic question: I have this
I am new to JavaScript, I have a very basic question. I have this
Possible Duplicate: Javascript dynamic variable name A very basic question. I want to create
I have a page with some very basic examples that use HTML/CSS/JavaScript. I'd like
I have a very basic mysql table called memberships, that tracks which people belong
I have a very basic API in my app which also has an index
I have a very basic app with two ignition-remoteimageviews (RIV) in them. The app
I have some very basic semaphore code that works great on Linux, but cannot
I have to do a very basic thing with javascript: A form field is
I have a very basic question about PHP. So, there is index.php that includes

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.