Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Compare javascript variables

Posted on 2013-01-21
2
Medium Priority
?
117 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 1000 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 84

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 1000 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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone 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

This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
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…
Suggested Courses

916 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