JSFiddle - React, Tailwind, and code Playground

by Julian Garcia Castillo

JavaScript

let books= [{added_date: 4},{added_date: 1}, {added_date: 3},{added_date: 5}]
  books.sort(function(a, b) {
      return b.added_date - a.added_date;
    });
    
    console.log(books)