I have a presentation like this, of course, with more books, I want to sort the books based on the oldest and newest, how should I do this?
const userBooks = [
  {
    id: 1,
    name: "",
    author: "",
    genre: "",
    date: "2022-1-12",
  },
  {
    id: 2,
    name: "",
    author: "",
    genre: "",
    date: "2022-2-8",
  },
];
 
     
     
    