Merge pull request #684 from simonebrunozzi/patch-1

Update ch2.md
This commit is contained in:
Kyle Simpson 2016-03-20 13:13:33 -07:00
commit a5b49a8ec0

View File

@ -47,7 +47,7 @@ a = { b: "c" };
typeof a; // "object"
```
The return value from the `typeof` operator is always one of six (seven as of ES6!) string values. That is, `typeof "abc"` returns `"string"`, not `string`.
The return value from the `typeof` operator is always one of six (seven as of ES6! - the "symbol" type) string values. That is, `typeof "abc"` returns `"string"`, not `string`.
Notice how in this snippet the `a` variable holds every different type of value, and that despite appearances, `typeof a` is not asking for the "type of `a`", but rather for the "type of the value currently in `a`." Only values have types in JavaScript; variables are just simple containers for those values.