Merge pull request #13127 from Greenheart/fix/oop-closure-typo

fix(challenge): small typo in "OOP: Use closure protection"
pull/13128/head
Dylan 2017-02-03 22:20:24 -06:00 committed by GitHub
commit b0ec9f6e02
1 changed files with 2 additions and 2 deletions

View File

@ -900,7 +900,7 @@
"id": "587d7db2367417b2b2512b8a",
"title": "Use Closure to Protect Properties Within an Object from Being Modified Externally",
"description": [
"In the previous challenge, <code>bird</code> had a public property <code>name</code>. It is considered public because it can be accessed and changed outside of <code>bird</code> definition.",
"In the previous challenge, <code>bird</code> had a public property <code>name</code>. It is considered public because it can be accessed and changed outside of <code>bird</code>'s definition.",
"<blockquote>bird.name = \"Duffy\";</blockquote>",
"Therefore, any part of your code can easily change the name of <code>bird</code> to any value. Think about things like passwords and bank accounts being easily changeable by any part of your codebase. That could cause a lot of issues.",
"The simplest way to make properties private is by creating a variable within the constructor function. This changes the scope of that variable to be within the constructor function versus available globally. This way, the property can only be accessed and changed by methods also within the constructor function.",