Javascript – Extracting values from array and adding them to new elements
I've got some code which loops through an array of products, it records new categories found and also how many times a category is found: const categoriesFound = (catArray) => { let categories = {} for (let i = 0;…