Here is a code snippet i want to return the supplier id on a condition if at date is less than or equal to rounddate then it should return the supplier ID
const currentRound = 0;
const roundDate = new Date('2021-12-02T10:41:57.133Z');
const offers = [
{
by: 'supplier',
user_Id: '46a065f05229450e805a0a38d94b0956',
supplier_id: '7a444fea780d90ddc7c35e09104c73b0',
total: 14700,
round: 0,
at: '2021-12-01T10:46:52.278Z',
},
{
by: 'supplier',
user_Id: '6fb6562bd52fd70b3f43aea1da76de16',
supplier_id: 'abc7c8e6b5acc1888ebf5d2398c44d0b',
total: 14800,
round: 0,
at: '2021-12-03T04:59:45.137Z',
},
];
const suppliersWhoSubmitBid = offers.map((e) =>
e.round === currentRound && new Date(e.at) <= roundDate && e.supplier_id
);
expected result = [ '7a444fea780d90ddc7c35e09104c73b0' ]
actual result = [ '7a444fea780d90ddc7c35e09104c73b0', false]