Hola, a todos, estoy haciendo una pagina web y necesito hacer con javascript que me diga un listado de los 10 actores femeninos de menor edad
aquí en el codigo hago que me traiga el nombre del actor femenino y su año de nacimiento, pero no se como hacer para que me diga cual es menor
obviamente la variable artistas en mucho mas larga, pero no voy a ponerles 100 artistas acá jeje
Gracias de antemano!!
aquí en el codigo hago que me traiga el nombre del actor femenino y su año de nacimiento, pero no se como hacer para que me diga cual es menor
obviamente la variable artistas en mucho mas larga, pero no voy a ponerles 100 artistas acá jeje
Código (javascript) [Seleccionar]
var artistas = [{
"birthday": "1969-08-28",
"deathday": null,
"id": 70851,
"name": "Jack Black",
"also_known_as": ["Thomas Jacob Black"],
"gender": 2,
"popularity": 7.018596,
"place_of_birth": "Santa Monica, California, USA",
"profile_path": "\/kAyKg3rYGgIhB5KRaIWALuf78W3.jpg",
"adult": false,
"imdb_id": "nm0085312",
"homepage": null
},
{
"birthday": "1990-08-15",
"deathday": null,
"id": 72129,
"name": "Jennifer Lawrence",
"also_known_as": ["Jennifer Shrader Lawrence"],
"gender": 1,
"popularity": 15.156473,
"place_of_birth": "Indian Hills, Kentucky, USA",
"profile_path": "\/naZyy9IqAQDaAbr1kYShLdg6aPR.jpg",
"adult": false,
"imdb_id": "nm2225369",
"homepage": "http:\/\/jenniferlawrencefoundation.com\/"
},
{
"birthday": "2004-01-12",
"deathday": null,
"id": 1304602,
"name": "Ahn Seo-hyun ",
"gender": 1,
"biography": "Ahn Seo-hyun (안서현) is a South Korean actress.",
"popularity": 0.737586,
"profile_path": "\/6clumbtJbR8cOEakvsJ3tyExGj7.jpg",
"adult": false,
"imdb_id": "nm3673821",
"homepage": null
},
{
"birthday": "1986-06-11",
"deathday": null,
"id": 10959,
"name": "Shia LaBeouf",
"also_known_as": ["Shia LeBouef", "Shia Saide LaBeouf", "Shia La Beouf",
"Shea LaBeouf", "Shia LaBuff"
],
"gender": 2,
"place_of_birth": "Los Angeles, California, USA ",
"profile_path": "\/anP0tygzniIok6L3OxcSZ9TYCF3.jpg",
"adult": false,
"imdb_id": "nm0479471",
"homepage": null
},
{
"birthday": "1962-10-26",
"deathday": null,
"id": 2130,
"name": "Cary Elwes",
"also_known_as": [" Ivan Simon Cary Elwes "],
"gender": 2,
"popularity": 1.659178,
"place_of_birth": "London - England - UK",
"profile_path": "\/wmvYoJHStQeQzrpqOM9tkvf1wwF.jpg",
"adult": false,
"imdb_id": "nm0000144",
"homepage": null
},
{
"birthday": "1980-05-19",
"deathday": null,
"id": 1237617,
"name": "Chris Jarvis",
"also_known_as": [],
"gender": 0,
"place_of_birth": "Poole - Dorset - England - UK",
"profile_path": "\/qKnRPTMNu3OCllA6MRIcvf79VJl.jpg",
"adult": false,
"imdb_id": "nm1587983",
"homepage": null
},
{
"birthday": "1973-07-03",
"deathday": null,
"id": 17178,
"name": "Patrick Wilson",
"also_known_as": [],
"gender": 2,
"popularity": 2.102733,
"place_of_birth": "Norfolk, Virginia, USA",
"profile_path": "\/djhTpbOvrfdDsWZFFintj2Uv47a.jpg",
"adult": false,
"imdb_id": "nm0933940",
"homepage": null
},
{
"birthday": "1977-04-02",
"deathday": null,
"id": 17288,
"name": "Michael Fassbender",
"also_known_as": [],
"gender": 2,
"popularity": 12.201965,
"place_of_birth": "Heidelberg - Baden-Württemberg - Germany",
"profile_path": "\/oexNPLumoFpazzzUqzBSDDYiUg1.jpg",
"adult": false,
"imdb_id": "nm1055413",
"homepage": null
},
{
"birthday": "1978-02-07",
"deathday": null,
"id": 18976,
"name": "Ashton Kutcher",
"also_known_as": [],
"gender": 2,
"popularity": 2.517249,
"place_of_birth": "Cedar Rapids, Iowa, USA",
"profile_path": "\/cGEvhWHlJmSrYfkpfCtfZVeRVsP.jpg",
"adult": false,
"imdb_id": "nm0005110",
"homepage": null
},
{
"birthday": "1968-09-25",
"deathday": null,
"id": 2888,
"name": "Will Smith",
"gender": 2,
"popularity": 12.95219,
"place_of_birth": " Philadelphia, Pennsylvania, USA",
"profile_path": "\/2iYXDlCvLyVO49louRyDDXagZ0G.jpg",
"adult": false,
"imdb_id": "nm0000226",
"homepage": "http:\/\/www.willsmith.com\/"
},
{
"birthday": "1968-11-18",
"deathday": null,
"id": 887,
"name": "Owen Wilson",
"also_known_as": [],
"gender": 2,
"popularity": 7.032109,
"place_of_birth": "Dallas - Texas - USA",
"profile_path": "\/j7oYgvfDiO34VcFdSB7GhM2CSle.jpg",
"adult": false,
"imdb_id": "nm0005562",
"homepage": "http:\/\/wilson-brothers.com\/"
},
{
"birthday": "1976-03-26",
"deathday": null,
"id": 20189,
"name": "Amy Smart",
"also_known_as": [],
"gender": 1,
"popularity": 9.396306,
"place_of_birth": "Topanga Canyon, California, USA",
"profile_path": "\/yTWkJVYq1wtn2NrnPIwXshTWqby.jpg",
"adult": false,
"imdb_id": "nm0005442",
"homepage": "http:\/\/www.amy-smart.com\/"
},
{
"birthday": "1957-12-21",
"deathday": null,
"id": 15757,
"name": "Ray Romano",
"also_known_as": [],
"gender": 2,
"popularity": 3.477725,
"place_of_birth": "Queens, New York, USA",
"profile_path": "\/mB8HQPuL0DYtjjlFaU7TPKvKruJ.jpg",
"adult": false,
"imdb_id": "nm0005380",
"homepage": null
},
{
"birthday": "1990-04-15",
"deathday": null,
"id": 10990,
"name": "Emma Watson",
"gender": 1,
"popularity": 12.127983,
"place_of_birth": "Paris, France",
"profile_path": "\/pMjCFPe3oLBaVXw7qfFzrwA0WXD.jpg",
"adult": false,
"imdb_id": "nm0914612",
"homepage": null
},
{
"birthday": "1982-10-10",
"deathday": null,
"id": 221018,
"name": "Dan Stevens",
"also_known_as": [" Daniel Jonathan Stevens"],
"gender": 2,
"popularity": 6.548622,
"place_of_birth": "Croydon, Surrey, England, UK",
"profile_path": "\/jNiY649MK85UFMosJIDxJ9HgIsC.jpg",
"adult": false,
"imdb_id": "nm1405398",
"homepage": "http:\/\/www.dan-stevens.co.uk"
},
{
"birthday": "1978-11-28",
"deathday": null,
"id": 1128383,
"name": "Juana Acosta",
"also_known_as": [],
"gender": 1,
"popularity": 1.52391,
"place_of_birth": "Cali, Colombia",
"profile_path": "\/p3c7FK60Hz6rXYsSVjzdzTzQ3sk.jpg",
"adult": false,
"imdb_id": "nm0010207",
"homepage": "http:\/\/www.juana-acosta.com\/noticias\/"
},
{
"birthday": "1927-10-14",
"deathday": "2017-05-23",
"id": 10222,
"name": "Roger Moore",
"also_known_as": ["로저 무어", "Sir Roger Moore", "Сэр Роджер Мур"],
"gender": 2,
"popularity": 4.30093,
"place_of_birth": "Stockwell, London, England, UK",
"profile_path": "\/8tnAaHY6cehjC9B6mIvxaFPewbh.jpg",
"adult": false,
"imdb_id": "nm0000549",
"homepage": "http:\/\/roger-moore.com"
},
{
"birthday": "1945-02-12",
"deathday": null,
"id": 10342,
"name": "Maud Adams",
"also_known_as": [],
"gender": 1,
"popularity": 1.153331,
"place_of_birth": "Luleå, Norrbottens län, Sweden",
"profile_path": "\/iflQAeAUNW9zhwNGYCvk0nZR1en.jpg",
"adult": false,
"imdb_id": "nm0000726",
"homepage": null
},
{
"birthday": "1972-05-02",
"deathday": null,
"id": 18918,
"name": "Dwayne Johnson",
"gender": 2,
"popularity": 16.545048,
"place_of_birth": "Hayward, California, USA",
"profile_path": "\/akweMz59qsSoPUJYe7QpjAc2rQp.jpg",
"adult": false,
"imdb_id": "nm0425005",
"homepage": null
},
{
"birthday": "1964-04-20",
"deathday": null,
"id": 1333,
"name": "Andy Serkis",
"also_known_as": [],
"gender": 2,
"popularity": 7.631553,
"place_of_birth": "Ruislip, Middlesex, UK",
"profile_path": "\/nQRsxFveJaUIlZ4GYWDe9uJ6u2f.jpg",
"adult": false,
"imdb_id": "nm0785227",
"homepage": "http:\/\/www.serkis.com\/"
},
{
{
"birthday": "1979-05-09",
"deathday": null,
"id": 5916,
"name": "Rosario Dawson",
"also_known_as": ["로자리오 도슨"],
"gender": 1,
"popularity": 6.914163,
"place_of_birth": "New York City, New York, USA",
"profile_path": "\/dEK1rMmSJAPGdc2t1XWdbqBmvEq.jpg",
"adult": false,
"imdb_id": "nm0206257",
"homepage": "http:\/\/rosario-dawson.net\/"
},
{
"birthday": "1960-11-05",
"deathday": null,
"id": 3063,
"name": "Tilda Swinton",
"also_known_as": [],
"gender": 1,
"popularity": 7.979976,
"place_of_birth": "London, United Kingdom",
"profile_path": "\/eGNo9qwlunvAi4kCVUEFtQFM5X.jpg",
"adult": false,
"imdb_id": "nm0842770",
"homepage": null
},
{
"birthday": "1973-08-06",
"deathday": null,
"id": 21657,
"name": "Vera Farmiga",
"also_known_as": [],
"gender": 1,
"popularity": 5.146505,
"place_of_birth": "Clifton, Passaic County, New Jersey, USA",
"profile_path": "\/oWZfxv4cK0h8Jcyz1MvvT2osoAP.jpg",
"adult": false,
"imdb_id": "nm0267812",
"homepage": null
},
{
"birthday": "1978-06-19",
"deathday": null,
"id": 8691,
"name": "Zoe Saldana",
"also_known_as": ["Zoë Saldana", "Zoe Saldaña", "Zoë Saldaña"],
"gender": 1,
"popularity": 11.831214,
"place_of_birth": "Passaic, New Jersey, USA",
"profile_path": "\/ofNrWiA2KDdqiNxFTLp51HcXUlp.jpg",
"adult": false,
"imdb_id": "nm0757855",
"homepage": "http:\/\/www.zoesaldana.com\/"
},
{
"birthday": "1983-02-21",
"deathday": null,
"id": 19119,
"name": "Mélanie Laurent",
"also_known_as": [],
"gender": 1,
"popularity": 3.167659,
"place_of_birth": "Paris, France",
"profile_path": "\/iYMyK6jYf46NoLOxU0agUeCvtjN.jpg",
"adult": false,
"imdb_id": "nm0491259",
"homepage": null
},
];
for (indiceGenero = 0; indiceGenero < artistas.length; indiceGenero++) {
var gender = artistas[indiceGenero].gender;
var nombre = artistas[indiceGenero].name;
if (gender == 1) {
console.log(nombre);
}
}
Gracias de antemano!!