i wanna store strings to an array which i got from a foreach loop how can i do it [duplicate]

This is the code which I wrote but I don’t know how to return the names and make them an array

const objects = [
  {
    name: "John",
    age: 30
  },
  {
    name: "Mike",
    age: 23
  }
];

const object = () => {
  Object.values(objects).forEach (element => {
    let names = element.name;

    console.log(names);
  });
};
object();