Skip to content

Commit

Permalink
Fix typo ch5 (types and grammar)
Browse files Browse the repository at this point in the history
Line 46: "statments" => "statements"
  • Loading branch information
machineloop committed Oct 20, 2015
1 parent 1c6f42e commit 79c4ff1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion types & grammar/ch5.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ The `b = a` assignment expression results in the value that was assigned (`18` a

**Note:** Technically, it's a little more complex than that. In the ES5 spec, section 12.2 "Variable Statement," the `VariableDeclaration` algorithm actually *does* return a value (a `string` containing the name of the variable declared -- weird, huh!?), but that value is basically swallowed up (except for use by the `for..in` loop) by the `VariableStatement` algorithm, which forces an empty (aka `undefined`) completion value.

In fact, if you've done much code experimenting in your console (or in a JavaScript environment REPL -- read/evaluate/print/loop tool), you've probably seen `undefined` reported after many different statments, and perhaps never realized why or what that was. Put simply, the console is just reporting the statement's completion value.
In fact, if you've done much code experimenting in your console (or in a JavaScript environment REPL -- read/evaluate/print/loop tool), you've probably seen `undefined` reported after many different statements, and perhaps never realized why or what that was. Put simply, the console is just reporting the statement's completion value.

But what the console prints out for the completion value isn't something we can use inside our program. So how can we capture the completion value?

Expand Down

0 comments on commit 79c4ff1

Please sign in to comment.