JavaScript is relatively easy to learn. However, gotchas abound in this tricky language. Are you sure that you’re not following any bad practices? Today, I’ll point out ten big mistakes you could be making.Mistake 1 – You’re Using Global Variables
Mistake 2 – You’re Not Using Semicolons
Mistake 3 – You’re Using ==
Mistake 4 – You’re using Type Wrapper Objects
Mistake 5 – You’re not Property-Checking when Using For-In
Mistake 6 – You’re Using with or eval
Mistake 7 – You’re Not Using a Radix When Using parseInt
Mistake 8 – You’re Not Using Braces on if and while statements
Mistake 9 – You’re Adding Elements to the DOM Individually
Mistake 10 – You’re Not Learning JavaScript
Mistake 11 – You’re Following all the Rules
Original article on nettuts.
Niciun comentariu:
Trimiteți un comentariu