Technology Programming

Five Most Common Coding Errors

< Continued from page 4

The fifth worst Javascript coding used by Javascript novices is to use the eval() method to evaluate variable names. The eval method is just about the least efficient statement that you can use in Javascript and most of the time its use in completely unnecessary.

The most common usage that people make is something along the lines of eval('myVar' + i) in order to generate a variable name that has a variable portion in the name.


Exactly the same variable can be referenced using window['myVar' + i] because all Javascript variables are automatically assigned as properties of the window object. Referencing the variables from the window object is much more efficient than using eval.

The use of eval should be reserved for those very rare instances where there is not any alternative way to produce the required result.

Related posts "Technology : Programming"

Brochure Design And Its Budget

Programming

Website designing delhi-web design services India-Website Development Company India

Programming

The Secrets and techniques Rob Fore Won't Tell you!

Programming

Where Do You Get Podcasting Ideas?

Programming

Avoid Hacking With The Help of WordPress Development Company

Programming

Sirius Radio - All You At Any Time Wished to Know

Programming

How to Use a Check Box to Filter a List

Programming

Get professional help from website development Dublin- promote business growth

Programming

PHP Shopping Carts

Programming

Leave a Comment