scrimba
The JavaScript Language [JSL] Module 5 (Arrays)
Siyakuthanda
Go Pro!Bootcamp

Bootcamp

Study group

Collaborate with peers in your dedicated #study-group channel.

Code reviews

Submit projects for review using the /review command in your #code-reviews channel

Siyakuthanda
by
AboutCommentsNotes
Siyakuthanda
by
Expand for more info
index.js
run
preview
console
let actorsList = [
{ name: "Chadwick Boseman", yearOfBirth: 1976, fromAfrica: false },
{ name: "Lupita Nyong'o", yearOfBirth: 1983, fromAfrica: true },
{ name: "Michael B. Jordan", yearOfBirth: 1987, fromAfrica: false },
{ name: "Danai Gurira", yearOfBirth: 1978, fromAfrica: true },
{ name: "Letitia Wright", yearOfBirth: 1993, fromAfrica: false },
{ name: "Winston Duke", yearOfBirth: 1986, fromAfrica: false },
{ name: "Angela Bassett", yearOfBirth: 1958, fromAfrica: false },
{ name: "Forest Whitaker", yearOfBirth: 1961, fromAfrica: false },
{ name: "Daniel Kaluuya", yearOfBirth: 1989, fromAfrica: true },
// Add an Actor (11 in Total)
];

// Task 1: Create a new array `actorNames` that contains only the names of the actors using the `map` method.


// Task 2: Use the `filter` method to create a new array `africanActors` that contains only the actors from Africa.
Console
[
"Chadwick Boseman"
,
"Lupita Nyong'o"
,
"Michael B. Jordan"
,
"Danai Gurira"
,
"Letitia Wright"
,
"Winston Duke"
,
"Angela Bassett"
,
"Forest Whitaker"
,
"Daniel Kaluuya"
]
,
[
{name:
"Lupita Nyong'o"
, yearOfBirth:
1983
, fromAfrica:
true
}
,
{name:
"Danai Gurira"
, yearOfBirth:
1978
, fromAfrica:
true
}
,
{name:
"Daniel Kaluuya"
, yearOfBirth:
1989
, fromAfrica:
true
}
]
,
/index.html
LIVE