We need to keep track of the school students, but the data we currently have combines the students first and last names into a single name. You have been asked to separate the names to make the data easier to work with.
The makeStudentList function takes an object with a name property whose value will be a string consisting of a first name and a last name, separated by a space. The function should return an object.
The function should remove the name property, replace it with firstName and lastName properties, as shown in the examples below.
Examples:
makeStudentList({ name: "Hannah Fry", age: 4 }) // should return { firstName: "Hannah", lastName: "Fry", age: 4 }
makeGuestList({ name: "Paul Erdős", age: 6 }) // should return { firstName: "Paul", lastName: "Erdős", age: 6 }