From f70d42b5ae4793692c7ab5dcc4998a04940c8b80 Mon Sep 17 00:00:00 2001 From: Ezequiel Monforte Date: Fri, 1 Feb 2019 01:41:06 -0300 Subject: [PATCH 01/18] First --- content/docs/lists-and-keys.md | 76 +++++++++++++++++----------------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/content/docs/lists-and-keys.md b/content/docs/lists-and-keys.md index bc3c6a4f1..ef842f8b0 100644 --- a/content/docs/lists-and-keys.md +++ b/content/docs/lists-and-keys.md @@ -1,14 +1,14 @@ --- id: lists-and-keys -title: Lists and Keys +title: Listas y keys permalink: docs/lists-and-keys.html prev: conditional-rendering.html next: forms.html --- -First, let's review how you transform lists in JavaScript. +Primero, vamos a revisar como transformas listas en Javascript. -Given the code below, we use the [`map()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) function to take an array of `numbers` and double their values. We assign the new array returned by `map()` to the variable `doubled` and log it: +Dado el codigo de abajo, usamos el [`map()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) function to take an array of `numbers` and double their values. We assign the new array returned by `map()` to the variable `doubled` and log it: ```javascript{2} const numbers = [1, 2, 3, 4, 5]; @@ -16,15 +16,15 @@ const doubled = numbers.map((number) => number * 2); console.log(doubled); ``` -This code logs `[2, 4, 6, 8, 10]` to the console. +Este codigo muestra `[2, 4, 6, 8, 10]` a la consola. -In React, transforming arrays into lists of [elements](/docs/rendering-elements.html) is nearly identical. +En react, transformar arrays en listas de [elementos](/docs/rendering-elements.html) es casi identico. -### Rendering Multiple Components +### Renderizando Multiples Componentes -You can build collections of elements and [include them in JSX](/docs/introducing-jsx.html#embedding-expressions-in-jsx) using curly braces `{}`. +Puedes hacer colecciones de elementos e [incluirlos en JSX](/docs/introducing-jsx.html#embedding-expressions-in-jsx) usando llaves `{}`. -Below, we loop through the `numbers` array using the JavaScript [`map()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) function. We return a `
  • ` element for each item. Finally, we assign the resulting array of elements to `listItems`: +Debajo, recorreremos el arreglo `numbers` usando la funcion [`map()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) de Javascript. Devolvemos un elemento `
  • ` por cada item . Finalmente, asignamos el array resultante de elementos a `listItems`: ```javascript{2-4} const numbers = [1, 2, 3, 4, 5]; @@ -33,7 +33,7 @@ const listItems = numbers.map((number) => ); ``` -We include the entire `listItems` array inside a `