Skip to content
This repository was archived by the owner on Aug 9, 2024. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion es5/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
1. [Functions](#functions)
1. [Properties](#properties)
1. [Variables](#variables)
1. [Constants](#constants)
1. [Hoisting](#hoisting)
1. [Comparison Operators & Equality](#comparison-operators--equality)
1. [Blocks](#blocks)
Expand Down Expand Up @@ -367,7 +368,7 @@
var superPower = new SuperPower();
```

- Use single `var` declaration for multiple variables.
- Use a single `var` declaration for multiple variables.
Having one `var` declaration per variable is an unnecessary code repetition
and it should hardly ever be a problem anyway as you always want to strive
at simple functions with as few local variables as possible. If you need
Expand Down Expand Up @@ -479,6 +480,23 @@
**[⬆ back to top](#table-of-contents)**


## Constants

- JavaScript doesn't support a notion of constants so we resort to normal
class variables in their absence. So to denote a variable is meant to be
treated like a constant you should use the ALL_CAPS notation, e.g.:

```
WHICH.MyClass.MY_CONSTANT = 'fooBar';
```

Please note, it is still possible to assign a different value to this kind
of variables so they should only be used as read-only properties. If you
need to change their values, use a standard variables notation.

**[⬆ back to top](#table-of-contents)**


## Hoisting

- Variable declarations get hoisted to the top of their scope, but their assignment does not.
Expand Down