diff --git a/GLOSSARY.md b/GLOSSARY.md index df45c9343..590b8ebb4 100644 --- a/GLOSSARY.md +++ b/GLOSSARY.md @@ -18,9 +18,10 @@ Glossary of the translations of technical and React-specific terms. - tag - lifecycle - callback +- console +- warning - form/forms - # Common Translations Suggestion on words and terms: diff --git a/content/docs/lists-and-keys.md b/content/docs/lists-and-keys.md index f34e9e5d6..705f0b30f 100644 --- a/content/docs/lists-and-keys.md +++ b/content/docs/lists-and-keys.md @@ -1,301 +1,301 @@ --- id: lists-and-keys -title: Lists and Keys +title: Liste e Chiavi permalink: docs/lists-and-keys.html prev: conditional-rendering.html next: forms.html --- -First, let's review how you transform lists in JavaScript. +Prima di iniziare, rivediamo come trasformare le liste in 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: +Nel codice qui sotto, usiamo la funzione [`map()`](https://developer.mozilla.org/it/docs/Web/JavaScript/Reference/Global_Objects/Array/map) per prendere un array di `numeri` e raddoppiarne i valori. Assegniamo il nuovo array restituito da `map()` alla variabile `lista` e lo stampiamo a console: ```javascript{2} -const numbers = [1, 2, 3, 4, 5]; -const doubled = numbers.map((number) => number * 2); -console.log(doubled); +const numeri = [1, 2, 3, 4, 5]; +const lista = numeri.map((numero) => numero * 2); +console.log(lista); ``` -This code logs `[2, 4, 6, 8, 10]` to the console. +Questo codice mostra `[2, 4, 6, 8, 10]` nella console. -In React, transforming arrays into lists of [elements](/docs/rendering-elements.html) is nearly identical. +Trasformare array in liste di [elementi](/docs/rendering-elements.html) con React è quasi identico. -### Rendering Multiple Components {#rendering-multiple-components} +### Renderizzare Liste di Componenti {#rendering-multiple-components} -You can build collections of elements and [include them in JSX](/docs/introducing-jsx.html#embedding-expressions-in-jsx) using curly braces `{}`. +Puoi creare liste di elementi e [usarle in JSX](/docs/introducing-jsx.html#embedding-expressions-in-jsx) usando le parentesi graffe `{}`. -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`: +Di seguito, eseguiamo un ciclo sull'array `numeri` usando la funzione JavaScript [`map()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map). Ritorniamo un elemento `
  • ` per ogni elemento dell'array. Infine, assegniamo l'array risultante a `lista`: ```javascript{2-4} -const numbers = [1, 2, 3, 4, 5]; -const listItems = numbers.map((number) => -
  • {number}
  • +const numeri = [1, 2, 3, 4, 5]; +const lista = numeri.map((numero) => +
  • {numero}
  • ); ``` -We include the entire `listItems` array inside a `