Created
August 16, 2019 23:05
-
-
Save parzibyte/7e4d83560ac3c856b887e562de980c9a 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.keys toma las claves, para este ejemplo serían | |
// los nombres de alumnos | |
let alumnos = Object.keys(alumnosConCalificaciones); | |
console.log("Claves: ", alumnos); | |
/*Salida: | |
Claves: [ 'Luis', 'Pedro', 'María José', 'John Galt' ] | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment