Recents in Beach

All Page Type Fetch and count category wise

 // 6. All Page Type Fetch

const allPageTypes = dataVisLog.data.map(v => v.page_type);
const uniqelyPageType = [...new Set(allPageTypes.filter(Boolean))];
//  [...new Set(allPageTypes.filter(Boolean))];
console.log("All Page Types Uniqely: ", uniqelyPageType);

✅ null / undefined বাদ দিà§Ÿে COUNT
করার কোড


const counts = result.data.reduce((acc, item) => { // ✅ null / undefined বাদ if (!item.page_type) return acc; // ✅ count acc[item.page_type] = (acc[item.page_type] || 0) + 1; return acc; }, {});

Post a Comment

0 Comments