Skip to content

Commit

Permalink
obj practice
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike-std-cpu committed Oct 18, 2022
1 parent bafb0b5 commit 0198223
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions Projects/objetos.js
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);

0 comments on commit 0198223

Please sign in to comment.