Skip to content

Commit b801b53

Browse files
authored
Merge pull request lydiahallie#531 from web20opensource/master
Fixes to question 76
2 parents 4ba60e1 + da723b3 commit b801b53

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2402,13 +2402,13 @@ console.log(name);
24022402
<details><summary><b>Answer</b></summary>
24032403
<p>
24042404

2405-
#### Answer: D
2405+
#### Answer: A
24062406

24072407
When we unpack the property `name` from the object on the right-hand side, we assign its value `"Lydia"` to a variable with the name `myName`.
24082408

24092409
With `{ name: myName }`, we tell JavaScript that we want to create a new variable called `myName` with the value of the `name` property on the right-hand side.
24102410

2411-
Since we try to log `name`, a variable that is not defined, a ReferenceError gets thrown.
2411+
Since we try to log `name`, a variable that is not defined, `undefined` is returned on the left side assignment. Later, the value of `Lydia` is stored through the destructuring assignment.
24122412

24132413
</p>
24142414
</details>

0 commit comments

Comments
 (0)