-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathborrar
More file actions
64 lines (46 loc) · 1.17 KB
/
borrar
File metadata and controls
64 lines (46 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
const Superheroes = Object.create (
{
hero1:
{
name: 'Superman',
power: 'flying',
velmax: 10000,
velmin: 5000,
}
hero2:
{
name: 'mujer maravilla',
power: 'flying',
velmax: 14000,
velmin: 6000,
}
hero3:
{
name: 'batman',
power: 'flying',
velmax: 11000,
velmin: 1000,
}
hero4:
{
name: 'super f',
power: 'flying',
velmax: 13000,
velmin: 3000,
}
hero5:
{
name: 'hombre araña',
power: 'flying',
velmax: 7000,
velmin: 9000,
}
});
// del anterior objeto imprimir una lista de los tres heroes mas veloces del valor velmax en codigo js
let heroesList = Object.values(Superheroes);
// crear array de los valores del objeto Superheroes
heroesList.sort((a,b) => b.velmax - a.velmax).slice(0, 3).forEach((hero) => {
console.log(`${hero.name} is the fastest with a max speed of ${hero.velmax}`);
});
"pokemon": [ "stats": { "base-attack": "118", "base-defense": "111", "base-stamina": "128", "max-cp": "1115", "max-hp": "113" },
necesito sacar el numero 111