Skip to content

Commit 29b4499

Browse files
Merge pull request #278 from ezzep66/json-methods
JSON methods, toJSON
2 parents da86cb5 + 3084859 commit 29b4499

File tree

4 files changed

+123
-123
lines changed

4 files changed

+123
-123
lines changed

1-js/05-data-types/12-json/1-serialize-object/task.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ importance: 5
22

33
---
44

5-
# Turn the object into JSON and back
5+
# Convierte el objeto en JSON y de vuelta
66

7-
Turn the `user` into JSON and then read it back into another variable.
7+
Convierte el `user` a JSON y luego léalo de vuelta en otra variable.
88

99
```js
1010
let user = {

1-js/05-data-types/12-json/2-serialize-event-circular/solution.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,5 @@ alert( JSON.stringify(meetup, function replacer(key, value) {
2626
*/
2727
```
2828

29-
Here we also need to test `key==""` to exclude the first call where it is normal that `value` is `meetup`.
29+
Aquí también necesitamos verificar `propiedad==""` para excluir el primer llamado donde es normal que `valor` sea `meetup`.
3030

1-js/05-data-types/12-json/2-serialize-event-circular/task.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ importance: 5
22

33
---
44

5-
# Exclude backreferences
5+
# Excluir referencias circulares
66

7-
In simple cases of circular references, we can exclude an offending property from serialization by its name.
7+
En casos simples de referencias circulares, podemos excluir una propiedad infractora de la serialización por su nombre.
88

9-
But sometimes we can't just use the name, as it may be used both in circular references and normal properties. So we can check the property by its value.
9+
Pero a veces no podemos usar el nombre, ya que puede usarse tanto en referencias circulares como en propiedades normales. Entonces podemos verificar la propiedad por su valor.
1010

11-
Write `replacer` function to stringify everything, but remove properties that reference `meetup`:
11+
Escriba la función `replacer` para convertir a string todo, pero elimine las propiedades que hacen referencia a `meetup`:
1212

1313
```js run
1414
let room = {
@@ -22,16 +22,16 @@ let meetup = {
2222
};
2323

2424
*!*
25-
// circular references
25+
// referencias circulares
2626
room.occupiedBy = meetup;
2727
meetup.self = meetup;
2828
*/!*
2929

3030
alert( JSON.stringify(meetup, function replacer(key, value) {
31-
/* your code */
31+
/* tu código */
3232
}));
3333

34-
/* result should be:
34+
/* el resultado debería ser:
3535
{
3636
"title":"Conference",
3737
"occupiedBy":[{"name":"John"},{"name":"Alice"}],

0 commit comments

Comments
 (0)