Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Commit 71d9f6f

Browse files
committed
Update README.md
Fix bug in example
1 parent f0b8a63 commit 71d9f6f

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

javascript/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,14 @@ Use semi-colons!
9595

9696
```javascript
9797
// bad
98+
var x
9899
a = b
99-
f() // this will evaluate to `a = b f()`, which will be a parse error
100+
(f()) // this will evaluate to `a = b(f())`, which is not what we intended.
100101

101102
// good
103+
var x;
102104
a = b;
103-
f();
105+
(f());
104106
```
105107

106108
##Use function expressions over function declarations

0 commit comments

Comments
 (0)