-
Notifications
You must be signed in to change notification settings - Fork 65
Expand file tree
/
Copy pathex6a.js
More file actions
22 lines (17 loc) · 881 Bytes
/
ex6a.js
File metadata and controls
22 lines (17 loc) · 881 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/**
* Convertir los nombres de los jugadores a mayúsculas
*
* En Mario Party, cuando un jugador gana una estrella, grita su nombre con emoción.
* Dado un array de nombres de jugadores, devuelve un nuevo array donde todos los nombres están en mayúsculas.
*/
function shoutPlayerNames(players) {
// RECUERDA: PRIMERO escribe lo que hay que hacer con tus palabras. Luego, viene el código
let arrayUpperCase = [];
// Codificar aquí....
return arrayUpperCase;
}
// Ejemplo de uso:
console.log(shoutPlayerNames(["Mario", "Luigi", "Peach"])); // ["MARIO", "LUIGI", "PEACH"]
console.log(shoutPlayerNames(["Bowser", "Yoshi", "Toad"])); // ["BOWSER", "YOSHI", "TOAD"]
console.log(shoutPlayerNames(["daisy", "wario", "waluigi"])); // ["DAISY", "WARIO", "WALUIGI"]
console.log(shoutPlayerNames(["rosalina"])); // ["ROSALINA"] -> Un solo jugador también grita