-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bafb0b5
commit 0198223
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// - Un objeto con tus datos personales (nombre, apellido, edad, altura, eresDesarrollador) | ||
const me = { | ||
name: "Miguel", | ||
lastName: "Andrade", | ||
age: 25, | ||
hight: 1.80, | ||
areuDeveloper: true | ||
} | ||
// - Una variable que obtenga tu edad a partir del objeto anterior | ||
const ageObj = me.age; | ||
console.log(ageObj); | ||
// - Una lista que contenga el objeto con tus datos personales y un nuevo objeto con los datos personales de tus dos mejores amig@s | ||
const bros = [ | ||
{ | ||
name: "Miguel", | ||
lastName: "Andrade", | ||
age: 25, | ||
hight: 1.80, | ||
areuDeveloper: true | ||
}, | ||
{ | ||
name: "Cristhian", | ||
lastName: "Martinez", | ||
age: 26, | ||
hight: 1.60, | ||
isDeveloper: true | ||
}, | ||
{ | ||
name: "Tristran", | ||
lastName: "Orta", | ||
age: 24, | ||
hight: 1.74, | ||
areuDeveloper: true | ||
} | ||
] | ||
// - Una nueva lista con los objetos de la lista anterior ordenados por edad, de mayor a menor | ||
|
||
bros.sort((a, b) =>{ a.age - b.age}); | ||
console.log(bros); |