- Use const and let
- Local Variable Declaration
- File Name
- Package Name
- Class Name
- Method Name
- Constant Name
- Parameter Name
1. Use const and let
Declare all local variables with either const or let. Use const by default, unless a variable needs to be reassigned. The var keyword must not be used.
2. Local Variable Declaration
Declare the local variables with either let or const keyword. Use const by default if the variable doesn’t need to be reassigned.
Local variable names are written in lowerCamelCase.
One variable per declaration. (For example:
let a = 1 , b = 2 // It’s not good practice.)
3. File Name
File names must be all lowercase and may include underscores (
_ ) or dashes (
- ), but no additional punctuation. Follow the convention that your project uses.
4. Package Name
Package names are all lowerCamelCase. (For example,
my.testExample.deepSpace, but not
5. Class Name
Class names, interface names, typedef, and record names are all UpperCamelCase.
6. Method Name
Method names must be lowerCamelCase.
7. Constant Name
Constant names should be all UPPER_CASE, separated by underscores.
8. Parameter Name
Parameter names are written in lowerCamelCase.
Thank you for reading. Happy Coding!