mapping functions

Solutions on MaxInterview for mapping functions by the best coders in the world

showing results for - "mapping functions"
Anusha
28 Nov 2020
1  //lets practice on mapping over objects in an array, it's so easy :)
2  //mappinmg function us used to go run over various functions in an object array and select a certain object depending on command given 
3  const theNames = [
4    {name: "Kinsley", age: "20", gender: "male", levelOfEducation: "uniStudent"},
5    {name: "Grace", age: "20", gender: "female", levelOfEducation: "uniStudent"},
6    {name: "Skeetah", age: "12", gender: "female", levelOfEducation: "pupil"},
7    {name: "Mishell", age: "16", gender: "female", levelOfEducation: "student"},
8    {name: "Mac", age: "24", gender: "male", levelOfEducation: "uniStudent"},
9    {name: "Shelby", age: "32", gender: "male", levelOfEducation: "postGraduate"},
10    {name: "Sasha", age: "22", gender: "female", levelOfEducation: "uniStudent"}
11  ];
12  const dataInList = theNames.map((listedNames) => {
13    return listedNames.name;
14  });
15  console.log(dataInList);