Solved

Compare javascript variables

Posted on 2013-01-21
2
109 Views
Last Modified: 2013-03-05
Is there any differences between

if (txtSample1 == txtSample2)
{
}

and

if (txtThisIsaTestSampleLongProgram1 == txtThisIsaTestSampleLongProgram2)
{
}

in performance?  which one will run faster or the same?
0
Comment
Question by:ttta83
2 Comments
 
LVL 39

Accepted Solution

by:
Pratima Pharande earned 250 total points
ID: 38804018
I don't think variable name matters in performance , but short varibale names are handy

refer
http://stackoverflow.com/questions/1809153/maximum-length-of-variable-name-in-javascript
0
 
LVL 83

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 250 total points
ID: 38804332
Most programming languages convert variable names in the preprocessor to something that the machine can use better.  I don't think the name matters unless you get ridiculous.
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Avoid defining the variables in the global scope; trying to define them in a local function scope. Because:   • Look-up is performed every time a variable is accessed.   • Variables are resolved backwards from most specific to least specific scope…
Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question