-
-
Save parzibyte/ca0eb2f7672bb02060f2837a58080938 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Ahora no es constante porque cambiaremos su valor más tarde | |
let arreglo = ["Hola", "Animales fantásticos", "Elefante", "Berenjena", "Uno"]; | |
console.log("Antes de ordenar: ", arreglo); | |
arreglo.sort(); | |
// Justo aquí lo invertimos | |
arreglo = arreglo.reverse(); | |
console.log("Después de ordenar: ", arreglo); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment