21 lines
584 B
JavaScript
21 lines
584 B
JavaScript
/**
|
|
* Esercizio: Convertitore Celsius-Fahrenheit
|
|
*
|
|
* Obiettivo: Utilizzare .map() per trasformare dati numerici.
|
|
*
|
|
* GradiFahrenheit = (GradiCelsius * 1.8) + 32
|
|
*
|
|
* 1. Dato l'array 'temperatureCelsius' fornito.
|
|
* 2. Usa il metodo .map() per creare un nuovo array 'temperatureFahrenheit'.
|
|
* 3. Assicurati che ogni numero venga convertito correttamente.
|
|
* 4. Stampa il nuovo array.
|
|
*/
|
|
|
|
let temperatureCelsius = [0, 10, 20, 30, 100];
|
|
|
|
// Scrivi qui il tuo codice usando .map()
|
|
|
|
|
|
|
|
// ZONA TEST - NON MODIFICARE
|
|
// temperatureFahrenheit dovrebbe essere: [32, 50, 68, 86, 212]
|