Fix spelling (#36111)

"hachedEgg" -> "hatchedEgg"
This commit is contained in:
Natalie Cardot
2019-05-22 15:42:44 -07:00
committed by Tom
parent 4438eb0f33
commit db1b435775

View File

@ -32,7 +32,7 @@ let ducky = new Bird();
ducky.getHatchedEggCount(); // returns 10
```
Here <code>getHachedEggCount</code> is a privileged method, because it has access to the private variable <code>hatchedEgg</code>. This is possible because <code>hatchedEgg</code> is declared in the same context as <code>getHachedEggCount</code>. In JavaScript, a function always has access to the context in which it was created. This is called <code>closure</code>.
Here <code>getHatchedEggCount</code> is a privileged method, because it has access to the private variable <code>hatchedEgg</code>. This is possible because <code>hatchedEgg</code> is declared in the same context as <code>getHatchedEggCount</code>. In JavaScript, a function always has access to the context in which it was created. This is called <code>closure</code>.
</section>