JSFiddle - React, Tailwind, and code Playground

by John Wick

JavaScript

/* 
Create a JS function that will filter the variable favordrop all expired,
get the items that are 
and the result will looks output variable.
 */
var favordrop = [
	{
  	formal_name: 'sarah',
    merchant_id: 100,
    status: 'expired'
  },
  {
  	formal_name: 'sarah',
    merchant_id: 100,
    status: 'expired'
  },
	{
  	formal_name: 'bill',
    merchant_id: 200,
    status: 'expired'
  },
  {
  	formal_name: 'john',
    merchant_id: 300,
    status: 'expired'
  },
  {
  	formal_name: 'jackal',
    merchant_id: 400,
    status: 'active'
  },
];

var output=
{
	formal_name: 'sarah',
  merchant_id: 100,
  status: 'expired'
}