Computers and Technology

// given this zoo data from around the united states, follow the instructions below. use the specific array methods in the requests below to solve the problems.

const zooanimals = [

{ animal_name: "jackal, asiatic", population: 5, scientific_name: "canis aureus", state: "kentucky" },

{ animal_name: "screamer, southern", population: 1, scientific_name: "chauna torquata", state: "alabama" },

{ animal_name: "white spoonbill", population: 8, scientific_name: "platalea leucordia", state: "georgia" },

{ animal_name: "white-cheeked pintail", population: 1, scientific_name: "anas bahamensis", state: "oregon" },

{ animal_name: "black-backed jackal", population: 2, scientific_name: "canis mesomelas", state: "washington" },

{ animal_name: "brolga crane", population: 9, scientific_name: "grus rubicundus", state: "new mexico" },

{ animal_name: "common melba finch", population: 5, scientific_name: "pytilia melba", state: "pennsylvania" },

{ animal_name: "pampa gray fox", population: 10, scientific_name: "pseudalopex gymnocercus", state: "connecticut" },

{ animal_name: "hawk-eagle, crowned", population: 10, scientific_name: "spizaetus coronatus", state: "florida" },

{ animal_name: "australian pelican", population: 5, scientific_name: "pelecanus conspicillatus", state: "west virginia" },

];

/* request 1: .foreach()

the zoos want to display both the scientific name and the animal name in front of the habitats. populate the displaynames array with only the animal_name and scientific_name of each animal. displaynames will be an array of strings, and each string should follow this pattern: "name: jackal, asiatic, scientific: canis aureus."

*/

const displaynames = [];

console. log(displaynames);

/* request 2: .map()

the zoos need a list of all their animal's names (animal_name only) converted to lower case. using map, create a new array of strings named lowcaseanimalnames, each string following this pattern: "jackal, asiatic". log the resut.

*/

const lowcaseanimalnames = [];

console. log(lowcaseanimalnames);

/* request 3: .filter()

the zoos are concerned about animals with a lower population count. using filter, create a new array of objects called lowpopulationanimals which contains only the animals with a population less than 5.

*/

const lowpopulationanimals = [];

console. log(lowpopulationanimals);

/* request 4: .reduce()

the zoos need to know their total animal population across the united states. find the total population from all the zoos using the .reduce() method. remember the reduce method takes two arguments: a callback (which itself takes two args), and an initial value for the count.

*/

const populationtotal = 0;

console. log(populationtotal);

/*

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 04:00, AngiT
Which spereadsheet type will determine how well a bussiness has done over the past year
Answers: 1
image
Computers and Technology, 22.06.2019 11:00, lexhorton2002
The great length of north america causes the climate to be varied. true false
Answers: 2
image
Computers and Technology, 22.06.2019 14:30, chaparro0512
Create a pseudocode design to prompt a student for their student id and the titles of the three classes they want to add. the solution should display the student’s id and a total bill. • bill a student using the following rules: o students can only add up to 3 classes at a time.
Answers: 3
image
Computers and Technology, 23.06.2019 00:30, lm18618
Which one of the following is considered a peripheral? a software b mouse c usb connector d motherboard
Answers: 2
Do you know the correct answer?
// given this zoo data from around the united states, follow the instructions below. use the specifi...

Questions in other subjects:

Konu
Mathematics, 12.10.2019 15:00
Konu
History, 12.10.2019 15:00
Konu
Mathematics, 12.10.2019 15:00