Solved

Compare javascript variables

Posted on 2013-01-21
2
106 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
Comment Utility
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 82

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 250 total points
Comment Utility
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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

This article shows how to create and access 2-dimensional arrays in JavaScript.  It includes a tutorial in case you are just trying to "get your head wrapped around" the concept and we'll also look at some useful tips for more advanced programmers. …
In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
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…

772 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now