Skip to content

Commit

Permalink
types+grammar: removing 'void' in ch1 code example in favor of ch2 co…
Browse files Browse the repository at this point in the history
…verage, closes getify#167
  • Loading branch information
getify committed Aug 7, 2014
1 parent e03f31e commit 070e1bc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion types & grammar/ch1.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,13 @@ var a;
typeof a; // "undefined"

var b = 42;
var c;

// later
b = void 0;
b = c;

typeof b; // "undefined"
typeof c; // "undefined"
```

It's tempting for most developers to think of the name "undefined" and think of it as a synonym for "undeclared". However, in JS, these two concepts are quite different.
Expand Down

0 comments on commit 070e1bc

Please sign in to comment.