Skip to content

Commit 53946c5

Browse files
committed
[functions] add source about func declarations & blocks in different browsers
1 parent e52a615 commit 53946c5

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@
255255
```
256256

257257
- Never declare a function in a non-function block (if, while, etc). Assign the function to a variable instead. Browsers will allow you to do it, but they all interpret it differently, which is bad news bears.
258+
- **Note:** ECMA-262 defines a `block` as a list of statements. A function declartion is not a statement. (Read ECMA-262's note on this issue)[http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf#page=97].
258259

259260
```javascript
260261
// bad

0 commit comments

Comments
 (0)