Created
August 16, 2019 23:07
-
-
Save parzibyte/5b477077cc5a79bbb998d8a8f288e0e3 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
/** | |
* Convertir un objeto a un arreglo | |
* en JavaScript | |
* | |
* @author parzibyte | |
* | |
* https://parzibyte.me/blog | |
*/ | |
let alumnosConCalificaciones = { | |
"Luis": 100, | |
"Pedro": 90, | |
"María José": 100, | |
"John Galt": 99 | |
}; | |
// Object.values toma los valores, para este ejemplo serían | |
// las calificaciones | |
let calificaciones = Object.values(alumnosConCalificaciones); | |
console.log("Valores: ", calificaciones); | |
/*Salida: | |
Valores: [ 100, 90, 100, 99 ] | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment