1. Naming conventions for identifiers

  • The naming of variables and functions must be meaningful
  • Variables are usually named with nouns
  • The names of functions are usually verbs

2. operator specification

For (var I = 1; i <= 5; i++) { if (i == 3) { break; } console.log(' I'm eating the first '+ I + ');} console.log(' I'm eating the first' + I + '); }Copy the code

3. Single-line comment specification

for (var i = 1; i <= 5; i++) { if (i == 3) { break; } console.log(' I am eating the first '+ I +' baozi '); }Copy the code

4. Other specifications

Add Spaces between keywords and operators