Recommended Uncle Tom Blog Garden in-depth understanding of JavaScript series
This article source: http://www.cnblogs.com/TomXu/archive/2011/12/28/2286877.html
Write maintainable code (Writing maintainable code) i.e.
Blog Park "Walker's technical Notes" in the Reference code specification and read and write maintainability can be used as a reference, I also reproduced the article to their own blog Park http://www.cnblogs.com/wolongjv/articles/5937898.html
Summarized as:
1. Readability (Code style consistent, code logic clear, just the right comment)
2. Maintainability (code not to write dead)
The small difference between implicit global variables and well-defined global variables is the delete
ability to make variables undefined by using operators.
- Global variables created by VAR (created in programs other than functions) cannot be deleted.
- Implicit global variables created without VAR (regardless of whether they were created in a function) can be deleted.
//define three global variablesvarGlobal_var = 1; Global_novar= 2;// Negative(function() {Global_fromfunc= 3;// Negative}());//attempt to deleteDeleteGlobal_var;//falseDeleteGlobal_novar;//trueDeleteGlobal_fromfunc;//true//Test the deletiontypeofGlobal_var;//"Number"typeofGlobal_novar;//"undefined"typeofGlobal_fromfunc;//"undefined"
The previous JS variable mentions a variable declared with the consent of Var
var car = "PORSCHE", name = ' Cayenne ', price = 888000;
0003. In-depth understanding of JavaScript Series Learning: The basics of writing high-quality JavaScript code