- Notifications
You must be signed in to change notification settings - Fork230
Prototype methods, objects without __proto__#195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
vplentinax merged 6 commits intojavascript-tutorial:masterfromcortizg:es.javascript.info.1-08-04-pmJun 3, 2020
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
Show all changes
6 commits Select commitHold shift + click to select a range
d96e8e1
1-08-04-pm Traducido 15
cortizge8f41e7
revisión 2020-05-29
cortizgad49226
revision 2020-05-30
cortizg9d22f63
revision 2020-05-30 2
cortizg0b52022
revision 2020-05-30 3
cortizgc1a6bfb
Merge branch 'master' into es.javascript.info.1-08-04-pm
vplentinaxFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
24 changes: 12 additions & 12 deletions1-js/08-prototypes/04-prototype-methods/2-dictionary-tostring/solution.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,31 @@ | ||
El método puede tomar todas las claves enumerables usando`Object.keys`y generar su lista. | ||
Para hacer que`toString`no seaenumerable,definámoslo usando un descriptor de propiedad. La sintaxis de `Object.create`nos permite proporcionar un objeto con descriptores de propiedad como segundo argumento. | ||
```js run | ||
*!* | ||
let dictionary = Object.create(null, { | ||
toString: { // definela propiedad toString | ||
value() { //el valor es una funcion | ||
return Object.keys(this).join(); | ||
} | ||
} | ||
}); | ||
*/!* | ||
dictionary.apple = "Manzana"; | ||
dictionary.__proto__ = "prueba"; | ||
//manzana y __proto__están en el ciclo | ||
for(let key in dictionary) { | ||
alert(key); // "manzana",despues "__proto__" | ||
} | ||
//lista de propiedades separadas por comas por toString | ||
alert(dictionary); // "manzana,__proto__" | ||
``` | ||
Cuando creamos una propiedad usando undescriptor,sus banderas son `false`por defecto. Entonces, en el código anterior, `dictionary.toString`no esenumerable. | ||
Consulte el capítulo[](info:property-descriptors)para su revisión. |
24 changes: 12 additions & 12 deletions1-js/08-prototypes/04-prototype-methods/2-dictionary-tostring/task.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions1-js/08-prototypes/04-prototype-methods/3-compare-calls/solution.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions1-js/08-prototypes/04-prototype-methods/3-compare-calls/task.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.