Solved

Compare javascript variables

Posted on 2013-01-21
2
110 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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'…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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…

839 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