Skip to content

Instantly share code, notes, and snippets.

// 把你本來分堆的地方改成一個 funciton
const groupCoupons = () => {
if (coupons.length !== 0) {
coupons.forEach(item => {
if (item.status === 'not_redeemed') {
const index = Object.values(couponFilter).map(i => i.cdId).indexOf(item.description)
if (index === -1) {
couponFilter.push({
cdId: item.description,
title: item.title,