Answers for "mapping functions"

0

mapping functions

//lets practice on mapping over objects in an array, it's so easy :)
  //mappinmg function us used to go run over various functions in an object array and select a certain object depending on command given 
  const theNames = [
    {name: "Kinsley", age: "20", gender: "male", levelOfEducation: "uniStudent"},
    {name: "Grace", age: "20", gender: "female", levelOfEducation: "uniStudent"},
    {name: "Skeetah", age: "12", gender: "female", levelOfEducation: "pupil"},
    {name: "Mishell", age: "16", gender: "female", levelOfEducation: "student"},
    {name: "Mac", age: "24", gender: "male", levelOfEducation: "uniStudent"},
    {name: "Shelby", age: "32", gender: "male", levelOfEducation: "postGraduate"},
    {name: "Sasha", age: "22", gender: "female", levelOfEducation: "uniStudent"}
  ];
  const dataInList = theNames.map((listedNames) => {
    return listedNames.name;
  });
  console.log(dataInList);
Posted by: Guest on September-15-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language