filter an array

PHOTO EMBED

Thu Mar 03 2022 00:42:27 GMT+0000 (Coordinated Universal Time)

Saved by @mmerkley #html

// Build a results array by comparing ** uses lodash
{{ results array }} = _.filter({{ orig array }}, item => {
  return _.isEqual({{ item to compare a }}, {{ to compare b }} );
});

// Build an array based on date
var todayDate = new Date();
    todayDate.setDate(new Date().getDate());
    {{ results array}} = _.filter({{ orig array }}, item => {
                        return _.isDate({{ valid date in UTC format }}) && {{ valid date in UTC format }} <= todayDate;
});
content_copyCOPY